in reply to Re^2: perl indication of end of string already matched
in thread perl indication of end of string already matched

>>How does the regex engine know that it matched $?

Hi.

I think engine doesn't know. It knows e.g. that it matched a zero-length branch once. And it cancels to match second time the same place in order to avoid eternal matching.
I believe you can get similar results with regexes like these: m/.|(?:)/gc, m/.|(?=)|(?:)/gc...