So I'd expect "foo\n" =~ /.*\z/; to match, but capture the empty string in $&, not "foo\n".
Of course there are more elaborate ways to match for a newline character ;-)
In reply to Re^3: Strange regex to test for newlines: /.*\z/
by moritz
in thread Strange regex to test for newlines: /.*\z/
by betterworld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |