On Fri, 05 Nov 1999 12:54:47 EST, Dan Sugalski wrote: > $search_string = "123abc"; > > sub foo { > $again = shift; > $search_string =~ /(\d+)(\w+)/; > print "$1 $2\n"; > return unless $again; > $search_string = "456def"; > foo(0); > print "$1 $2\n"; > } > > foo(1); > >produces: > >123 abc >456 def >456 def > >I don't recall seeing this documented anywhere, though it very well might be. Known bug. See: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1998-11/msg00648.html Ilya, this is a _serious_ bug in regular expressions, and I'm sad to see that it hasn't been fixed in more than a year. I have half a mind to be cruel and "motivate" fixing it by not accepting any RE patches until this is fixed. :-} Sarathy gsar@ActiveState.comThread Previous | Thread Next