Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Help with Regex

by siva kumar (Pilgrim)
on Feb 09, 2007 at 07:38 UTC ( [id://599172]=note: print w/replies, xml ) Need Help??


in reply to Help with Regex

Try this
1. Use ungreedy (.*?)
2. Treat the whole string as one line. use /s
my ($new_source) = $source =~ /<!-- InstanceBeginEditable name="guts" +-->(.*?)<!-- InstanceEndEditable -->/s;
instead of
my ($new_source) = $source =~ /<!-- InstanceBeginEditable name="guts" +-->(.*)<!-- InstanceEndEditable -->/;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-24 15:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found