in reply to Re:^4 positions of all regexp matches
in thread positions of all regexp matches

That's bug-like behavior. I don't know why it should find the same item twice there. A //g match is guaranteed not to match twice in the same place.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on •Re: Re:^4 positions of all regexp matches

Replies are listed 'Best First'.
Re: •Re: Re:^4 positions of all regexp matches
by sandfly (Beadle) on Oct 14, 2003 at 22:40 UTC
    Maybe it's something to do with the RE engine trying some optimization.

    The RE engine can execute a code block more than once in a single pattern match attempt, and this would lead to multiple entries for a given pos.