[thelist] Parsing camelcase text

Matt McKeon matt at camadro.com
Sun Jan 11 14:42:16 CST 2009


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].*)/
That works on a string containing only 2 words, but some strings may contain
more words. Can anyone help modify it to catch any number of words in a
string? I tried using a look ahead, but couldn't get it quite right.

I'm doing this in PHP with preg_match().

Thanks.



More information about the thelist mailing list