in reply to Regex: Case insensitive search but case sensitive replace
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/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regex: Case insensitive search but case sensitive replace
by Anonymous Monk on Nov 17, 2003 at 10:36 UTC | |
by Limbic~Region (Chancellor) on Nov 17, 2003 at 10:40 UTC | |
by Anonymous Monk on Nov 17, 2003 at 10:44 UTC |