D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
String
/
Filename :
match-i.ri
back
Copy
U:RDoc::AnyMethod[iI" match:ETI"String#match;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"SReturns a MatchData object (or +nil+) based on +self+ and the given +pattern+.;To:RDoc::Markup::BlankLine o; ; [I"0Note: also updates Regexp@Global+Variables.;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"IComputes +regexp+ by converting +pattern+ (if not already a Regexp).;To:RDoc::Markup::Verbatim; [I""regexp = Regexp.new(pattern) ;T:@format0o;;0; [o; ; [I"LComputes +matchdata+, which will be either a MatchData object or +nil+ ;TI"(see Regexp#match):;To;; [I"(matchdata = <tt>regexp.match(self) ;T;0o; ; [I";With no block given, returns the computed +matchdata+:;T@o;; [I",'foo'.match('f') # => #<MatchData "f"> ;TI",'foo'.match('o') # => #<MatchData "o"> ;TI"'foo'.match('x') # => nil ;T;0o; ; [I"PIf Integer argument +offset+ is given, the search begins at index +offset+:;T@o;; [I""'foo'.match('f', 1) # => nil ;TI"/'foo'.match('o', 1) # => #<MatchData "o"> ;T;0o; ; [I"GWith a block given, calls the block with the computed +matchdata+ ;TI"*and returns the block's return value:;T@o;; [I"E'foo'.match(/o/) {|matchdata| matchdata } # => #<MatchData "o"> ;TI"8'foo'.match(/x/) {|matchdata| matchdata } # => nil ;TI":'foo'.match(/f/, 1) {|matchdata| matchdata } # => nil;T;0: @fileI" string.c;T:0@omit_headings_from_table_of_contents_below0I"lmatch(pattern, offset = 0) -> matchdata or nil match(pattern, offset = 0) {|matchdata| ... } -> object ;T0[ I"(*args);T@=FI"String;TcRDoc::NormalClass00