Assuming that the word "camel's word" is defined as follows:
"The word of a camel" definition:
- It consists only of upper and lower case letters;
[A-Za-z]. - ;
[a-z]. - ;
[a-z].
Java- , :
import java.util.regex.*;
public class TEST {
public static void main(String[] args) {
String data = "This has one camelCase word."+
"This hasTwo camelCaseWords."+
"NON CamelCase withDigits123 words.";
Pattern re_camel_case_word = Pattern.compile(
" # Match one camelCase word.\n" +
" \\b # Anchor to word boundary. \n" +
" [a-z]+ # Begin with one or more lowercase alphas. \n" +
" (?: # One or more parts starting with uppercase. \n" +
" [A-Z] # At least one uppercase alpha \n" +
" [a-z]* # followed by zero or more lowercase alphas. \n" +
" )+ # One or more parts starting with uppercase. \n" +
" \\b # Anchor to word boundary.",
Pattern.COMMENTS);
Matcher matcher = re_camel_case_word.matcher(data);
while (matcher.find())
System.out.println(matcher.group(0));
}
}
, -- . , " ".