るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.013秒)
トップページ > クラス:Symbol[x] > クエリ:match[x] > バージョン:2.3.0[x]

別のキーワード

  1. _builtin match
  2. _builtin match?
  3. string match
  4. regexp match
  5. regexp last_match

ライブラリ

検索結果

Symbol#match(other) -> Integer | nil (54397.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