2件ヒット
[1-2件を表示]
(0.281秒)
検索結果
-
MatchData
# to _ s -> String (87328.0) -
マッチした文字列全体を返します。
マッチした文字列全体を返します。
//emlist[例][ruby]{
/bar/ =~ "foobarbaz"
p $~ # => #<MatchData:0x401b1be4>
p $~.to_s # => "bar"
//} -
Symbol
# match(other) -> Integer | nil (78418.0) -
正規表現 other とのマッチを行います。
正規表現 other とのマッチを行います。
(self.to_s.match(other) と同じです。)
@param other 比較対象のシンボルを指定します。
@return マッチが成功すればマッチした位置を、そうでなければ nil を返します。
p :foo.match(/foo/) # => 0
p :foobar.match(/bar/) # => 3
p :foo.match(/bar/) # => nil
@see String#match