J
John W. Long
What's the equivalent to perl's reexp pos function in ruby?
___________________
John Long
www.wiseheartdesign.com
___________________
John Long
www.wiseheartdesign.com
I don't know what perl's pos does, but here.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:
. . .
I know about MatchData. Perl's pos function basically returns the position
of the end of the current match. Which sounds like MatchData#end, the
difference is you can set pos so that you specify the begining in the string
of the next search. I haven't seen anything in Ruby like this.
Hi,
At Fri, 9 Apr 2004 10:53:51 +0900,
John W. Long wrote in [ruby-talk:96846]:I know about MatchData. Perl's pos function basically returns the position
of the end of the current match. Which sounds like MatchData#end, the
difference is you can set pos so that you specify the begining in the string
of the next search. I haven't seen anything in Ruby like this.
Use 2nd argument to String#index.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.