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 ;)
In reply to Re: New regex trick...
by broquaint
in thread New regex trick...
by japhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |