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