Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


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?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (1)
As of 2026-05-12 12:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.