Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Multiline match

by LanX (Chancellor)
on May 23, 2013 at 16:20 UTC ( #1034972=note: print w/ replies, xml ) Need Help??

in reply to Multiline match

> What am I missing here?

did you confuse /s and /m ?

see perlre


Treat string as multiple lines. That is, change "^" and "$" from matching the start or end of the string to matching the start or end of any line anywhere within the string.


Treat string as single line. That is, change "." to match any character whatsoever, even a newline, which normally it would not match.

Used together, as /ms, they let the "." match any character whatsoever, while still allowing "^" and "$" to match, respectively, just after and just before newlines within the string.

Cheers Rolf

( addicted to the Perl Programming Language)

Comment on Re: Multiline match

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2015-11-27 13:12 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (729 votes), past polls