D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
MatchData
/
Filename :
named_captures-i.ri
back
Copy
U:RDoc::AnyMethod[iI"named_captures:ETI"MatchData#named_captures;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"+Returns a hash of the named captures; ;TI"Leach key is a capture name; each value is its captured string or +nil+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"0m = /(?<foo>.)(.)(?<bar>.+)/.match("hoge") ;TI"/# => #<MatchData "hoge" foo:"h" bar:"ge"> ;TI"5m.named_captures # => {"foo"=>"h", "bar"=>"ge"} ;TI" ;TI"&m = /(?<a>.)(?<b>.)/.match("01") ;TI"(# => #<MatchData "01" a:"0" b:"1"> ;TI"3m.named_captures #=> {"a" => "0", "b" => "1"} ;TI" ;TI"&m = /(?<a>.)(?<b>.)?/.match("0") ;TI"'# => #<MatchData "0" a:"0" b:nil> ;TI"3m.named_captures #=> {"a" => "0", "b" => nil} ;TI" ;TI"&m = /(?<a>.)(?<a>.)/.match("01") ;TI"(# => #<MatchData "01" a:"0" a:"1"> ;TI"'m.named_captures #=> {"a" => "1"} ;T:@format0o; ; [I"4If keyword argument +symbolize_names+ is given ;TI">a true value, the keys in the resulting hash are Symbols:;T@o;; [I"&m = /(?<a>.)(?<a>.)/.match("01") ;TI"(# => #<MatchData "01" a:"0" a:"1"> ;TI"<m.named_captures(symbolize_names: true) #=> {:a => "1"};T; 0: @fileI" re.c;T:0@omit_headings_from_table_of_contents_below0I"4named_captures(symbolize_names: false) -> hash ;T0[ I"(p1 = {});T@*FI"MatchData;TcRDoc::NormalClass00