[thelist] Parsing camelcase text

Bill Moseley moseley at hank.org
Sun Jan 11 17:48:35 CST 2009


On Sun, Jan 11, 2009 at 03:42:16PM -0500, Matt McKeon wrote:
> I need to separate words that are in CamelCased form. After trying to use my
> weak regular expressions skills, I came up with the following half working
> solution: /([A-Z].*)([A-Z].*)/

CamelCase is lowercase followed by upper case, right?

$ echo CamelCasedWords | perl -pe 's/([a-z])([A-Z])/$1 $2/g'
Camel Cased Words

-- 
Bill Moseley
moseley at hank.org
Sent from my iMutt




More information about the thelist mailing list