Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^4: Strange regex to test for newlines: /.*\z/by xicheng (Sexton) |
on May 21, 2007 at 16:57 UTC ( [id://616602]=note: print w/replies, xml ) | Need Help?? |
hmm, Just notice that, thanks.. I think, .* and .{0,} at the beginning of a regex pattern shold have been treated as optional, so that /.*A/ and /.{0,}A/ should be the same as /A/ which means .* and .{0,} are completely unnecessary in the above patterns.. But \z looks behave very differently to .* and .{0,} as you mentioned. This looks like a Perl-related problem, PHP(use a similar regex engine) does it pretty well: Probably it's a bug, and I am waiting for someone to make it clear. :-) Regards, Xicheng
In Section
Seekers of Perl Wisdom
|
|