in reply to Re^2: Parsing CamelCase words
in thread Parsing CamelCase words
Ah, I thought you wanted to extract the words from the identifier, not extract the identifiers from the surrounding text.
Take my existing code to detect CamelCased words, and find repetitions of it:
@cc_words = /((?:[A-Z][a-z]*)+)/g;
If you don't want words that are all uppercase, it's easiest to just filter them out:
@cc_words = grep /[a-z]/, /((?:[A-Z][a-z]*)+)/g;
If you don't want CamelCase words with only one upper case letter, change the "+" to "{2,}".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Parsing CamelCase words
by kyte (Initiate) on Jun 12, 2009 at 21:41 UTC | |
by ikegami (Patriarch) on Jun 12, 2009 at 21:46 UTC |