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 reply to Re: RegEx Problem
by Kanji
in thread RegEx Problem
by L0rdPhi1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |