From: GGarramuno@... (GGarramuno) Date: 2004-01-03T03:21:46+09:00 Subject: Re: More questions about =~ Simon Strandgaard wrote in message news:... > On Thu, 01 Jan 2004 12:46:54 -0800, GGarramuno wrote: > > > BTW: Why are you interested in overloading the regexp methods? > Is it because you are writing your own regexp engine? Kind of. I was just trying to have an extended string class that stored the position of the last match position, to allow supporting something similar to Perl's pos() command (which allows continuing matches from the last match done or setting where to begin from like index() --- only it works for subs and all regex methods, too). I am porting some nasty perl code that makes heavy use of that feature. Ruby's regex engine already has the building blocks needed to support this feature, but the interface to it is not as easy to use as perl's. I had thought I could use ruby's excellent OO to add this seamlessly into the string class (and also make it work for any other string that used my module, too). But the fact that =~ of regex literals works in a non OO manner, has kind of put a damp on that idea.