in reply to Regex: Case insensitive search but case sensitive replace
Hard, but this seems to work
We do evaluation on right side of the substitution. With '#' in there it didn't work (might need more figuring out).$a="John is following jane"; $a=~s/(jane)/ucfirst(lc($1));/iee; print "$a\n";
|
---|
In Section
Seekers of Perl Wisdom