in reply to New regex trick...

So \K basically means don't worry, I only started matching *here*, where here is the position where the previous atom of the regex stopped matching e.g
my $str = "foo bar baz"; # will 'start' matching here ^ $str =~ s< (?: \w+ [ ] )+ \K \w+ >()x; print '[' . $str . ']'; __output__ [foo bar ]
Or should I just go back to implementing pointers in perl?
HTH

_________
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
    You've got the right idea (except for a missing whitespace in your output).

    _____________________________________________________
    Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;