Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Strange regex to test for newlines: /.*\z/

by bloonix (Monk)
on May 21, 2007 at 12:45 UTC ( #616544=note: print w/replies, xml ) Need Help??


in reply to Strange regex to test for newlines: /.*\z/

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!
  • Comment on Re: Strange regex to test for newlines: /.*\z/

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://616544]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2022-01-16 21:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (50 votes). Check out past polls.

    Notices?