30件ヒット
[1-30件を表示]
(0.045秒)
別のキーワード
検索結果
先頭3件
-
Regexp
# named _ captures -> { String => [Integer] } (18220.0) -
正規表現に含まれる名前付きキャプチャ(named capture)の情報を Hash で返します。
...のリストを返します。
//emlist[例][ruby]{
/(?<foo>.)(?<bar>.)/.named_captures
# => {"foo"=>[1], "bar"=>[2]}
/(?<foo>.)(?<foo>.)/.named_captures
# => {"foo"=>[1, 2]}
# 名前付きキャプチャを持たないときは空の Hash を返します。
/(.)(.)/.named_captures
# => {}
//}... -
NEWS for Ruby 2
. 4 . 0 (126.0) -
NEWS for Ruby 2.4.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...Kernel#clone は freeze というキーワード引数を受け付けるようになりました。
12300
* MatchData
* MatchData#named_captures を追加 11999
* MatchData#values_at は named captures をサポートするようになりました 9179
* Module
* Module#refin......Regexp/String: Unicodeのバージョンを8.0.0から9.0.0に更新しました 12513
* RubyVM::Env
* 削除しました
* String
* String#casecmp? を追加 12786
* String#concat, String#prepend 複数の引数を受け付けるようになりました 12333
* String#each_li......付けるようになりました 12553
* String#match? を追加 12898
* String#unpack1 を追加 12752
* String#upcase, String#downcase, String#capitalize, String#swapcase,
String#upcase!, String#downcase!, String#capitalize!, String#swapcase!
は全てのUnicodeに対し... -
MatchData
# captures -> [String] (107.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...