Cheers - L~R#!/usr/bin/perl -w use strict; my $string = 'John is following jane'; # Specific $string =~ s/[jJ]ane/##Jane##/; # To preserve j or J in replacement # $string =~ s/([jJ]ane)/##$1##/; # More generic # $string =~ s/(John is following) (\w+)/$1 \u$2/;
In reply to Re: Regex: Case insensitive search but case sensitive replace
by Limbic~Region
in thread Regex: Case insensitive search but case sensitive replace
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |