Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby27
/
share
/
ri
/
system
/
Regexp
/
//opt/alt/ruby27/share/ri/system/Regexp/last_match-c.ri
U:RDoc::AnyMethod[iI"last_match:ETI"Regexp::last_match;TT:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [ I"BThe first form returns the MatchData object generated by the ;TI"Nlast successful pattern match. Equivalent to reading the special global ;TI"Jvariable <code>$~</code> (see Special global variables in Regexp for ;TI"details).;To:RDoc::Markup::BlankLine o; ; [I"LThe second form returns the <i>n</i>th field in this MatchData object. ;TI"@_n_ can be a string or symbol to reference a named capture.;T@o; ; [I"MNote that the last_match is local to the thread and method scope of the ;TI"'method that did the pattern match.;T@o:RDoc::Markup::Verbatim; [I"#/c(.)t/ =~ 'cat' #=> 0 ;TI":Regexp.last_match #=> #<MatchData "cat" 1:"a"> ;TI"'Regexp.last_match(0) #=> "cat" ;TI"%Regexp.last_match(1) #=> "a" ;TI"%Regexp.last_match(2) #=> nil ;TI" ;TI"4/(?<lhs>\w+)\s*=\s*(?<rhs>\w+)/ =~ "var = val" ;TI"NRegexp.last_match #=> #<MatchData "var = val" lhs:"var" rhs:"val"> ;TI"'Regexp.last_match(:lhs) #=> "var" ;TI"&Regexp.last_match(:rhs) #=> "val";T:@format0: @fileI" re.c;T:0@omit_headings_from_table_of_contents_below0I"QRegexp.last_match -> matchdata Regexp.last_match(n) -> str ;T0[ I"(*args);T@&FI"Regexp;TcRDoc::NormalClass00