|
|
| P is for Practical | |
| PerlMonks |
Re: Strange regex to test for newlines: /.*\z/by bloonix (Monk) |
| on May 21, 2007 at 12:45 UTC ( [id://616544]=note: print w/replies, xml ) | Need Help?? |
|
thats correct because .* matches all but the newline and
\z search for the end of the string, but there still exists
the newline http://perldoc.perl.org/perlre.html "To match the actual end of the string and not ignore an optional trailing newline, use \z ."@tinita, @betterworld: Thanks to you because I saw that /m is not necessary in my code!
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||