From: "Dmitry V. Sabanin" Date: 2004-04-08T15:39:07+09:00 Subject: Re: perl pos function equivalent in ruby? On Thursday 08 April 2004 11:15, John W. Long wrote: > What's the equivalent to perl's reexp pos function in ruby? I don't know what perl's pos does, but here. Look at MatchData: $ ri MatchData ------------------------------------------------------------------------ class: MatchData ------------------------------------------------------------------------ MatchData is the type of the special variable $~, and is the type of the object returned by Regexp#match and Regexp#last_match. It encapsulates all the results of a pattern match, results normally accessed through the special variables $&, $', $`, $1, $2, and so on. Matchdata is also known as MatchingData. ------------------------------------------------------------------------ [], begin, end, length, offset, post_match, pre_match, select, size, string, to_a, to_s ------------------------------------------------------------------------ -- sdmitry -=- Dmitry V. Sabanin MuraveyLabs. Spam Here -> postmaster@sco.com