in reply to Re^3: Global regexp
in thread Global regexp

I think dealing with pos will result in ugly code: maybe code with cycle over string length or time consuming code.
So you mean perl regexps are always greedy: they match as much as possible and there's no way to configure them beside your approach with (?= ) ?

Replies are listed 'Best First'.
Re^5: Global regexp
by Corion (Patriarch) on Jun 17, 2008 at 12:29 UTC

    Basically yes - Perl regular expressions will always match the leftmost longest match. Any other approaches will need other regular expression engines. If you're running Perl 5.10, you have the option of using different regular expression engine (see re::engine).

      Thanks for clear explanation of perl insides.