On 4/3/07, via RT Andri <perlbug-followup@perl.org> wrote: > # New Ticket Created by Andri > # Please include the string: [perl #42289] > # in the subject line of all future correspondence about this issue. > # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42289 > > > > A zero-length match with \G seems not to match twice at the same position without doing pos()=pos() in the middle of those matches. > > Both \G(?=Welcome) and (?=\GWelcome) seem to not-match on my system. > perl -le '$_="Welcome to Estonia!"; print "1. Matches" if /\G(?=W)/gc; print "2. Should match, but does not" if /\G(?=Wel)/gc; pos=pos; print "3. Now matches again" if /\G(?=Welcome)/gc' > > That's it. Hopefully not intended behaviour ^_^ Yes this is correct. There is logic in place to prevent two zero length matches from occuring at the same place in a row. The second time the start position will be forced forward one character before matching. This baheviour prevents inifinte loops and also is behind the scenes responsible for split // afair. cheers, Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"Thread Previous