Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Really basic regex question!

by AnomalousMonk (Archbishop)
on Mar 24, 2016 at 06:13 UTC ( [id://1158695]=note: print w/replies, xml ) Need Help??


in reply to Really basic regex question!

Your  $code string seems to have newlines in it, and by default,  . (dot) (update: in the  .*? regex expression) does not match newlines. Try using the  /s (dot matches all) regex modifier on your substitution.

Update: Please see Modifiers;   s/// in Regexp Quote-Like Operators.


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^2: Really basic regex question!
by ultranerds (Hermit) on Mar 24, 2016 at 06:25 UTC
    Ah man - now I feel stupid! That worked perfectly, thanks! :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-26 05:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found