るりまサーチ

最速Rubyリファレンスマニュアル検索!
26件ヒット [1-26件を表示] (0.150秒)

別のキーワード

  1. rbconfig ruby
  2. fiddle build_ruby_platform
  3. fiddle ruby_free
  4. rubygems/defaults ruby_engine
  5. rake ruby

ライブラリ

クラス

キーワード

検索結果

MatchData#captures -> [String] (18336.0)

$1, $2, ... を格納した配列を返します。

...ープにマッチした部分文字列がなければ対応する要素は nil になります。

//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.to_a # => ["foobar", "foo", "bar", nil]
p $~.captures # => ["foo", "bar", nil]
//}

@
see MatchData#to_a, MatchData#named_captures...
...応する要素は nil になります。

//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.to_a # => ["foobar", "foo", "bar", nil]
p $~.captures # => ["foo", "bar", nil]
//}

@
see MatchData#to_a, MatchData#named_captures, d:spec/pattern_matching#matching_non_primitive_objects...

MatchData#deconstruct -> [String] (3236.0)

$1, $2, ... を格納した配列を返します。

...応する要素は nil になります。

//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.to_a # => ["foobar", "foo", "bar", nil]
p $~.captures # => ["foo", "bar", nil]
//}

@
see MatchData#to_a, MatchData#named_captures, d:spec/pattern_matching#matching_non_primitive_objects...

MatchData#to_a -> [String] (227.0)

$&, $1, $2,... を格納した配列を返します。

...$&, $1, $2,... を格納した配列を返します。

//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.to_a # => ["foobar", "foo", "bar", nil]
//}

@
see MatchData#captures...