Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How can I match a multi-line regexp?

by wesal (Initiate)
on Aug 11, 2010 at 20:50 UTC ( [id://854507]=note: print w/replies, xml ) Need Help??


in reply to How can I match a multi-line regexp?

To overcome the limitation with the quick in-place edit not working on matching the first-line you can remove the -p and do it yourself like:
perl -i.bak -e 'undef $/; $_=<>; s/line1\nline1/new content/g; print' files ..
  • Comment on Re: How can I match a multi-line regexp?

Replies are listed 'Best First'.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-25 23:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found