NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Yes, but.. (Score:1)
It's also one of the slower engines, and at least in Ruby 1.6 its \G doesn't prohibit regex bump-along (it's "start of current match" rather than "end of last match"), which makes relatively useless to write complex parsers with.
Personally, I'm waiting for Inline::Perl6 ;-)
Re:Yes, but.. (Score:2)
Reply to This
Parent
Re:Yes, but.. (Score:1)
When trying to match abcde with
/\Gx?/g, the first match is successful, because no x is found but the question mark allows zero characters to be consumed. This match ends after zero characters into the string at start-of-string. In order to avoid infinite loops on a zero-length matches, the engine then retries the match one position down the string.In Perl, \G means end-of-last-match, and since end-of-last-match was at start-of-string, \G can't possibly match at one character into the string: