Website hosting service by Active-Venture.com
 

 Back to Index

prev - up - next - index

Regexp

The Regexp is the class for regular expression matching. Regular expression literals are enclosed by slashes like:

/^this is regexp/

In other way, you can create the regular expression object using:

Regexp.new(string)

SuperClass:

Object

Class Methods:

compile(string[, casefold])
new(string[, options])

Compiles the string into a regular expression object. If second argument given, and its value is true, then the created regexp object becomes case-insensitive. the value of the second argument is Fixnum, it must be bitwise-or of Regexp::IGNORECASE and Regexp::EXTENDED.

quote(string)

Insert escape characters before regular expression special characters in the string. Returns the newly created strings.

Methods:

self =~ string
self === string

Returns an index of the matching place in the string, if matched. Returns nil if not matched. The index of the first character is 0.

~ self

Matches with the value of the default variable ($_). Behaves like:

self =~ $_
casefold?

Returns true if the Regexp is compiled as case-insensitive.

source

Returns the orginal string form of the regular expression.


prev - up - next - index

matz@netlab.co.jp

 

  

 

 

2002-2004 Active-Venture.com Website Hosting Service

 
Buy domain name at only $5.95/yr with comprehensive domain hosting services. Domain registration and domain search service from $5.95 Cheap domain name registration and domain transfer service
 

Disclaimer: This documentation is provided only for the benefits of our website hosting customers.
For authoritative source of the documentation, please refer to http://www.ruby-doc.org/docs/