prev - up - next - index

MatchingData

The status of the regular expression match. The value of the variable $~ is the instance of this class.

SuperClass:

Object

Methods:

size
length

Returns the number of the subpatterns (i.e. $~.to_a.size).

offset(n)

Returns the offsets ([start, end]) of the nth subpattern. 0 means the whole match.

begin(n)

Returns the starting offset of the nth match. 0 means the whole match.

end(n)

Returns the end offset of the nth match. 0 means the whole match.

to_a

Returns the array of the subpatterns, which is [$&, $1, $2,...].

self[n]

Returns the nth subpattern.

pre_match

Returns the string preceding the match (i.e. $`).

post_match

Returns the string following the match (i.e. $').

string

Returns the string where the match was performed.


prev - up - next - index

matz@netlab.co.jp