D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Regexp
/
Filename :
new-c.ri
back
Copy
U:RDoc::AnyMethod[iI"new:ETI"Regexp::new;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"NWith argument +string+ given, returns a new regexp with the given string ;TI"and options:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"&r = Regexp.new('foo') # => /foo/ ;TI"&r.source # => "foo" ;TI""r.options # => 0 ;T:@format0o; ; [I"9Optional argument +options+ is one of the following:;T@o:RDoc::Markup::List: @type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0; [o; ; [I"A String of options:;T@o;; [I")Regexp.new('foo', 'i') # => /foo/i ;TI"*Regexp.new('foo', 'im') # => /foo/im ;T; 0o;;0; [o; ; [I"5The bit-wise OR of one or more of the constants ;TI"BRegexp::EXTENDED, Regexp::IGNORECASE, Regexp::MULTILINE, and ;TI"Regexp::NOENCODING:;T@o;; [I"7Regexp.new('foo', Regexp::IGNORECASE) # => /foo/i ;TI"7Regexp.new('foo', Regexp::EXTENDED) # => /foo/x ;TI"7Regexp.new('foo', Regexp::MULTILINE) # => /foo/m ;TI"8Regexp.new('foo', Regexp::NOENCODING) # => /foo/n ;TI"Hflags = Regexp::IGNORECASE | Regexp::EXTENDED | Regexp::MULTILINE ;TI"9Regexp.new('foo', flags) # => /foo/mix ;T; 0o;;0; [o; ; [I"(+nil+ or +false+, which is ignored.;To;;0; [o; ; [I">Any other truthy value, in which case the regexp will be ;TI"case-insensitive.;T@o; ; [ I"6If optional keyword argument +timeout+ is given, ;TI"Cits float value overrides the timeout interval for the class, ;TI"Regexp.timeout. ;TI"BIf +nil+ is passed as +timeout, it uses the timeout interval ;TI"#for the class, Regexp.timeout.;T@o; ; [ I"EWith argument +regexp+ given, returns a new regexp. The source, ;TI"Goptions, timeout are the same as +regexp+. +options+ and +n_flag+ ;TI"Barguments are ineffective. The timeout can be overridden by ;TI"+timeout+ keyword.;T@o;; [I"!options = Regexp::MULTILINE ;TI">r = Regexp.new('foo', options, timeout: 1.1) # => /foo/m ;TI">r2 = Regexp.new(r) # => /foo/m ;TI";r2.timeout # => 1.1 ;TI">r3 = Regexp.new(r, timeout: 3.14) # => /foo/m ;TI";r3.timeout # => 3.14;T; 0: @fileI" re.c;T:0@omit_headings_from_table_of_contents_below0I"hRegexp.new(string, options = 0, timeout: nil) -> regexp Regexp.new(regexp, timeout: nil) -> regexp ;T0[ I"(*args);T@RFI"Regexp;TcRDoc::NormalClass00