るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. _builtin $-i
  5. _builtin i

ライブラリ

検索結果

MatchData#deconstruct -> [String] (15311.0)

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

...します。

MatchData
#to_a と異なり $& を要素に含みません。
グループにマッチした部分文字列がなければ対応する要素は nil になります。

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

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

MatchData#captures -> [String] (211.0)

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

...します。

MatchData
#to_a と異なり $& を要素に含みません。
グループにマッチした部分文字列がなければ対応する要素は nil になります。

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

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