19件ヒット
[1-19件を表示]
(0.047秒)
ライブラリ
- ビルトイン (19)
検索結果
先頭3件
-
Symbol
# match(other) -> MatchData | nil (18244.0) -
正規表現 other とのマッチを行います。
....match(other) と同じです。)
@param other 比較対象のシンボルを指定します。
@return マッチが成功すれば MatchData オブジェクトを、そうでなければ nil を返します。
p :foo.match(/foo/) # => #<MatchData "foo">
p :foobar.match(/bar/) # => #<Match......Data "bar">
p :foo.match(/bar/) # => nil
@see String#match
@see Symbol#match?... -
Symbol
# match(other) -> Integer | nil (18138.0) -
正規表現 other とのマッチを行います。
...elf.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... -
Symbol
# match?(regexp , pos = 0) -> bool (6182.0) -
regexp.match?(self, pos) と同じです。 regexp が文字列の場合は、正規表現にコンパイルします。 詳しくは Regexp#match? を参照してください。
...regexp.match?(self, pos) と同じです。
regexp が文字列の場合は、正規表現にコンパイルします。
詳しくは Regexp#match? を参照してください。
例:
:Ruby.match?(/R.../) # => true
:Ruby.match?('Ruby') # => true
:Ruby.match?('Ruby',1) # => false
:R......uby.match?('uby',1) # => true
:Ruby.match?(/P.../) # => false
$& # => nil
@see Regexp#match?, String#match?...