Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Regex: Case insensitive search but case sensitive replace

by Hena (Friar)
on Nov 17, 2003 at 12:09 UTC ( [id://307634]=note: print w/replies, xml ) Need Help??


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

Hard, but this seems to work
$a="John is following jane"; $a=~s/(jane)/ucfirst(lc($1));/iee; print "$a\n";
We do evaluation on right side of the substitution. With '#' in there it didn't work (might need more figuring out).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-19 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found