Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Replacing between patterns

by rsFalse (Hermit)
on Oct 29, 2019 at 13:25 UTC ( #11108068=note: print w/replies, xml ) Need Help??


in reply to Re: Replacing between patterns
in thread Replacing between patterns

Similarly, but with /m and $:
echo "123 ABC 123 abc XYZ hi la" | perl -0777 -pe 's/ ABC .*? XYZ .*? $ /[DATA]/msx' 123 [DATA] la

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2020-01-21 22:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?