in reply to Quick regexp question
You realize of course that there many other (probably better) ways to do this. Particularly, I wonder why you would need the \b, as [A-Z]{4,} is greedy and will take whole words on a match. And then there is of course the \L escape sequence. I would probably have done it like this:$a =~ s{\b([A-Z]{4,})\b}{ucfirst(lc($1))}eg; ^^^ slash removed
$a =~ s#([A-Z])([A-Z]{3,})#$1\L$2\E#g;
Liz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Quick regexp question
by bart (Canon) on Oct 05, 2003 at 14:01 UTC | |
by liz (Monsignor) on Oct 05, 2003 at 16:00 UTC | |
|
Re: Quick regexp question
by Abigail-II (Bishop) on Oct 05, 2003 at 22:01 UTC |