⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.93
Server IP:
65.108.141.171
Server:
Linux server.heloix.com 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
ri
/
2.7.0
/
system
/
MatchData
/
View File Name :
cdesc-MatchData.ri
U:RDoc::NormalClass[iI"MatchData:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"DMatchData encapsulates the result of matching a Regexp against ;TI"Gstring. It is returned by Regexp#match and String#match, and also ;TI"?stored in a global variable returned by Regexp.last_match.;To:RDoc::Markup::BlankLine o; ;[I"Usage:;T@o:RDoc::Markup::Verbatim;[I"@url = 'https://docs.ruby-lang.org/en/2.5.0/MatchData.html' ;TI"Am = url.match(/(\d\.?)+/) # => #<MatchData "2.5.0" 1:"0"> ;TI"[m.string # => "https://docs.ruby-lang.org/en/2.5.0/MatchData.html" ;TI"1m.regexp # => /(\d\.?)+/ ;TI"!# entire matched substring: ;TI".m[0] # => "2.5.0" ;TI" ;TI"%# Working with unnamed captures ;TI"/m = url.match(%r{([^/]+)/([^/]+)\.html$}) ;TI"=m.captures # => ["2.5.0", "MatchData"] ;TI".m[1] # => "2.5.0" ;TI"=m.values_at(1, 2) # => ["2.5.0", "MatchData"] ;TI" ;TI"## Working with named captures ;TI"Bm = url.match(%r{(?<version>[^/]+)/(?<module>[^/]+)\.html$}) ;TI"=m.captures # => ["2.5.0", "MatchData"] ;TI"Rm.named_captures # => {"version"=>"2.5.0", "module"=>"MatchData"} ;TI".m[:version] # => "2.5.0" ;TI"$m.values_at(:version, :module) ;TI"= # => ["2.5.0", "MatchData"] ;TI"*# Numerical indexes are working, too ;TI".m[1] # => "2.5.0" ;TI"=m.values_at(1, 2) # => ["2.5.0", "MatchData"] ;T:@format0S:RDoc::Markup::Heading: leveli: textI"!Global variables equivalence;T@o; ;[I"FParts of last MatchData (returned by Regexp.last_match) are also ;TI"!aliased as global variables:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o; ;[I"*<code>$~</code> is Regexp.last_match;;To;;0;[o; ;[I":<code>$&</code> is Regexp.last_match<code>[0]</code>;;To;;0;[o; ;[I"5<code>$1</code>, <code>$2</code>, and so on are ;TI"<Regexp.last_match<code>[i]</code> (captures by number);;To;;0;[o; ;[I"A<code>$`</code> is Regexp.last_match<code>.pre_match</code>;;To;;0;[o; ;[I"B<code>$'</code> is Regexp.last_match<code>.post_match</code>;;To;;0;[o; ;[I"N<code>$+</code> is Regexp.last_match<code>[-1]</code> (the last capture).;T@o; ;[I"ISee also "Special global variables" section in Regexp documentation.;T: @fileI" re.c;T:0@omit_headings_from_table_of_contents_below0;0;0[ [ [ [[I" class;T[[:public[ [:protected[ [:private[ [I" instance;T[[;[[I"==;TI" re.c;T[I"[];T@n[I" begin;T@n[I" captures;T@n[I"end;T@n[I" eql?;T@n[I" hash;T@n[I"inspect;T@n[I"length;T@n[I"named_captures;T@n[I" names;T@n[I"offset;T@n[I"post_match;T@n[I"pre_match;T@n[I"regexp;T@n[I" size;T@n[I"string;T@n[I" to_a;T@n[I" to_s;T@n[I"values_at;T@n[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;0;0[I"lib/pp.rb;T@Y@YcRDoc::TopLevel