Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Regex: find/Replace words between tags

by TomK32 (Monk)
on Dec 15, 2001 at 07:49 UTC ( [id://132179]=note: print w/replies, xml ) Need Help??


in reply to Regex: find/Replace words between tags

1) it's while not While
2) the replacing works wrong

#!/usr/bin/perl -w while(<DATA>){ $_=~s/^(BEGTITLE.*) (wirey) (.*ENDTITLE)$/\1 smooth \3/i; print $_; } __DATA__ BEGPUB Wirey Haired Dogs Life ENDPUB BEGTITLE My dog has wirey hair ENDTITLE BEGTXT My wirey hair dog...blah, blah. ENDTXT
and don't cut the extra spaces

-- package Lizard::King; sub can { do { 'anything'} };

Log In?
Username:
Password:

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

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

    No recent polls found