heman has asked for the wisdom of the Perl Monks concerning the following question:
Hi Guys,
I'm trying to read 5 lines and replace any character which starts with a lower case to upper case. and replace the remaining characters to lower case. ex:
perlmonk is a gREat site. i loVE it. in this case i expect the output to be: Perlmonk is a great site. I love it.
I'm trying to use the following string replacement scheme. however, i don't see the replacement of [A-Z] being recognized as a keyword. But, it does recognize in the 1st case where i'm searching for a-zA-Z.
s/^\s*[a-zA-Z]/[A-Z]/g
Not sure if i'm missing some detail.
Thanks
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: regular expression search and replace
by hippo (Archbishop) on Nov 18, 2014 at 17:55 UTC | |
Re: regular expression search and replace
by GrandFather (Saint) on Nov 18, 2014 at 19:55 UTC | |
by heman (Novice) on Nov 18, 2014 at 23:49 UTC | |
by GrandFather (Saint) on Nov 19, 2014 at 00:12 UTC | |
Re: regular expression search and replace
by AnomalousMonk (Archbishop) on Nov 19, 2014 at 00:17 UTC | |
Re: regular expression search and replace
by ronin78 (Novice) on Nov 18, 2014 at 17:56 UTC |