I would like to check if a string is a camel case or not (boolean). I am inclined to use a regex but any other elegant solution would work. I wrote a simple regex
(?:[A-Z])(?:[a-z])+(?:[A-Z])(?:[a-z])+
Would this be correct? Or am I missing something?
Edit
I would like to capture names in a collection of text documents of the format
McDowell
O'Connor
T.Kasting
Edit2
I have modified my regex based on the suggestion in the comments
(?:[A-Z])(?:\S?)+(?:[A-Z])(?:[a-z])+
camel
camel case? What about_camel
,Camel
,_Camel
,CONSTCAMEL
,HTML
, orvar_camelCase
? It's pretty difficult to define unless you know ahead of time what the formatting is.