No such thing as a small change | |
PerlMonks |
Re: RegEx Problemby Kanji (Parson) |
on May 29, 2002 at 00:38 UTC ( [id://169946]=note: print w/replies, xml ) | Need Help?? |
s/\B([A-Z])(?=[a-z])/-\l$1/g; # ? Although if you can guarantee that a capital letter will never occur at the beginning of the string and will always denote a new word (ie, samIAm), you can simplify that to just... s/([A-Z])/-\l$1/g; --k.
In Section
Seekers of Perl Wisdom
|
|