in reply to Re^2: Strange regex to test for newlines: /.*\z/
in thread Strange regex to test for newlines: /.*\z/
It probably would work with "\n" because .* could match 0 chars. But in your example, it already matched several chars before the \n which it refuses to slurp, so it (meaning the DFA) can't get to the \z at the end.
Of course, the more I think about it... you might argue that the .* should backtrack, skip over the \n and continue to match the 0 chars right before the \z. I believe \z has a special meaning though. It's not really matching characters. It's more of a border on things, like \b, so I suspect there really aren't 0 characters before it because it's not really there.
UPDATE: I'm completely convinced this is a bug based on "id-616551" below.
-Paul
|
|---|