fork download
  1. import re
  2. matches = []
  3. text = "Hi, How ARE You? SQLiteBrowser and I"
  4. for line in text.splitlines():
  5. matches.extend([x for x in re.findall(r'\w+', line) if x[0].isupper() and all(i.islower() for i in x[1:])])
  6. print(matches)
  7. # => ['Hi', 'How', 'You', 'I']
  8.  
Success #stdin #stdout 0.02s 9576KB
stdin
Standard input is empty
stdout
['Hi', 'How', 'You', 'I']