⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.127
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
ri
/
3.0.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\.?)+/) # => #
;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{(?
[^/]+)/(?
[^/]+)\.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"*
$~
is Regexp.last_match;;To;;0;[o; ;[I"<
$&
is Regexp.last_match
[ 0 ]
;;To;;0;[o; ;[I"5
$1
,
$2
, and so on are ;TI">Regexp.last_match
[ i ]
(captures by number);;To;;0;[o; ;[I"A
$`
is Regexp.last_match
.pre_match
;;To;;0;[o; ;[I"B
$'
is Regexp.last_match
.post_match
;;To;;0;[o; ;[I"P
$+
is Regexp.last_match
[ -1 ]
(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