fork(2) download
  1. import re
  2.  
  3. pattern = r"(?<!\S)[A-Z][a-z]*(?!\S)|([A-Z][a-z]*)"
  4. s = ("AppleOrange\nPomegranate Yellow Banana")
  5.  
  6. print([x for x in re.findall(pattern, s) if x])
Success #stdin #stdout 0.03s 9548KB
stdin
Standard input is empty
stdout
['Apple', 'Orange']