Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^4: Strange regex to test for newlines: /.*\z/by moritz (Cardinal) |
on May 21, 2007 at 15:10 UTC ( [id://616586]=note: print w/replies, xml ) | Need Help?? |
Sorry, I still don't get it.
Obviously /\z/ matches the string "f\n", so why should it fail to match if I prepend it with something that matches the empty string? This should be independent of where the end of the string is considered to be. And why does /.?\z/ match and /.*\z/ not? If we expand that scheme, why does /.?.?\z/ match, and /.*.?\z/ not? In all cases I'd expect .? and .* to be reduced to the empty string - why doesn't it happen?
In Section
Seekers of Perl Wisdom
|
|