Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Regex: Case insensitive search but case sensitive replace

by delirium (Chaplain)
on Nov 17, 2003 at 10:39 UTC ( [id://307622]=note: print w/replies, xml ) Need Help??


in reply to Regex: Case insensitive search but case sensitive replace

{using corny Get Smart accent} Missed it by that much.
Anyway, here's mine, using /i switch:

perl -le '$t="John is following jane"; $t=~s/(jane)/##$1##/i; print $t +' John is following ##jane## $perl -le '$t="John is following Jane"; $t=~s/(jane)/##$1##/i; print $ +t' John is following ##Jane##

Log In?
Username:
Password:

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

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

    No recent polls found