Update: the third one matches just coz of .* in use. \Z can not keep multiple newlines.perl -e 'print "match\n" if "foo\n" =~ /.*\z/' perl -e 'print "match\n" if "foo\n" =~ /.*\Z/' perl -e 'print "match\n" if "foo\n\n\n" =~ /.*\Z/'
In reply to Re^2: Strange regex to test for newlines: /.*\z/
by xicheng
in thread Strange regex to test for newlines: /.*\z/
by betterworld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |