in reply to Re^2: Strange regex to test for newlines: /.*\z/
in thread Strange regex to test for newlines: /.*\z/
AFAIK, .* and .{0,} should be exactly equivilent, but when combined with /z they are not, if the string ends in a newline.perl -e 'print "match\n" if "foo\n" =~ /.{0,}\z/'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Strange regex to test for newlines: /.*\z/
by xicheng (Sexton) on May 21, 2007 at 16:57 UTC |