Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Regex assistance, please.

by moritz (Cardinal)
on Oct 21, 2012 at 17:49 UTC ( #1000228=note: print w/ replies, xml ) Need Help??


in reply to Regex assistance, please.

elsif ($code_s =~ m{\G((?:.*$)*)(?!\s###+)}cgm) { #!!!!! # $1 only captures a single line # why not multiple lines complete with their \n?

Because the dot . doesn't match the newline character. Unless you add the /s modifier to your regex.


Comment on Re: Regex assistance, please.
Download Code
Re^2: Regex assistance, please.
by clueless newbie (Friar) on Oct 21, 2012 at 17:57 UTC

    Thank you, moritz. But changing the cgm to cgms causes $1 on the marked line to capture everything including the "Smart Comments"

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2014-11-01 14:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    If a safe, affordable anti-ageing treatment that extended life indefinitely were to become available, would you take it?



    Results (7 votes), past polls