Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$input =~ s/\.(.)\.WI$/\_\1\_w/g;
This is for parsing and changing input of the form:
ABC.A.WI - this is the initial string
ABC_A_w - this is what the above line currently does
ABD_a_w - this is what I want it to do
I was trying to implement the lc command within the replacement but could not get it to work. I also tried to sub in a tr/A-Z/a-z/ but again could not get the notation correct for it to work properly. Hopefully there is some obscure combination of brackets that will allow me to do something like lc(/1). Please help. Thanks, Martin.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: Converting case in a replacement
by jeffa (Bishop) on Aug 28, 2001 at 23:56 UTC | |
by Anonymous Monk on Aug 29, 2001 at 00:08 UTC | |
|
Re: Converting case in a replacement
by wog (Curate) on Aug 29, 2001 at 00:07 UTC | |
|
Re: lower case converison in pattern match
by VSarkiss (Monsignor) on Aug 29, 2001 at 00:09 UTC | |
|
Re: lower case converison in pattern match
by Masem (Monsignor) on Aug 29, 2001 at 00:08 UTC |