in reply to Converting case in a replacement

Try the \L and \E thingies (i prefer $1 instead of \1 on the 'replace' side - \1 really should be used on the 'match' side):
s/\.(.)\.WI$/\_\L$1\E\_w/g;
This produces 'ABC_a_w' - was the 'D' in 'ABD_a_w' a typo? Looks like it is.

UPDATE: to explain a little bit, \L means 'make the following lower case until \E (end) is found'. Conversely, you can upper case with \U.

jeffa

    A flute with no holes is not a flute . . .
a doughnut with no holes is a danish.
                                - Basho,
                                  famous philosopher

Replies are listed 'Best First'.
Re: (jeffa) Re: Converting case in a replacement
by Anonymous Monk on Aug 29, 2001 at 00:08 UTC
    Yeah it was a typo

    Thanks very much for your help!

    I was too busy looking in the books for info on pattern matching and regexp, didnt think to look at escape sequences.

    Thanks again!