in reply to Re^5: Did regex match fail because of "end of string"?
in thread Did regex match fail because of "end of string"?

There is another problem: false positives.

When you have a lookbehind or a {2,*} quantifier and remove them from the end you get matches that shouldn't work at all.

I know that this can be handled by repeating the match, but this whole business turns out to be so nasty that I'm discarding my original idea and simply slurp the whole file into memory... ;)