in reply to New regex trick...
Or should I just go back to implementing pointers in perl?my $str = "foo bar baz"; # will 'start' matching here ^ $str =~ s< (?: \w+ [ ] )+ \K \w+ >()x; print '[' . $str . ']'; __output__ [foo bar ]
_________
broquaint
update: added missing whitespace in output (odd how an additional character requires so many to explain ;)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: New regex trick...
by japhy (Canon) on Jul 22, 2002 at 19:50 UTC |