|
|
| Do you know where your variables are? | |
| PerlMonks |
Re^3: Strange regex to test for newlines: /.*\z/by moritz (Cardinal) |
| on May 21, 2007 at 14:02 UTC ( [id://616563]=note: print w/replies, xml ) | Need Help?? |
|
.* will match anything but a newline, or the empty string.
So I'd expect "foo\n" =~ /.*\z/; to match, but capture the empty string in $&, not "foo\n". Of course there are more elaborate ways to match for a newline character ;-)
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||