in reply to Regex: Overlapping Matches: Double Execution of Eval-ed Code

Simplistically, it is caused by the required backtracking. How many times it gets called is also dependant upon its relative position:

#! perl -sw use strict; use re 'eval'; my $s = 'abcdef'; our $n; $n = 0; my @groups = $s =~ m[(?{ print ++$n, ' '; })(?=(..))]g; print + $/; $n = 0; @groups = $s =~ m[(?=((?{ print ++$n, ' '; })..))]g; print + $/; $n = 0; @groups = $s =~ m[(?=(.(?{ print ++$n, ' '; }).))]g; print + $/; $n = 0; @groups = $s =~ m[(?=(..(?{ print ++$n, ' '; })))]g; print + $/; $n = 0; @groups = $s =~ m[(?=(..))(?{ print ++$n, ' '; })]g; print + $/; __END__ C:\test>junk57 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?