Skip to content
Advertisement

Check for camel case in Python

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

JavaScript

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

JavaScript

Edit2

I have modified my regex based on the suggestion in the comments

JavaScript

Advertisement

Answer

You could check if a string has both upper and lowercase.

JavaScript

Output:

JavaScript
Advertisement