fork download
  1. import re
  2. re_outer = re.compile(r'([^A-Z ])([A-Z])')
  3. re_inner = re.compile(r'\b[A-Z]+(?=[A-Z][a-z])')
  4. print(re_inner.sub(r'\g<0> ', re_outer.sub(r'\1 \2', 'DaveIsAFKRightNow!Cool')))
  5.  
  6. print(re_inner.sub(r'\g<0> ', re_outer.sub(r'\1 \2', 'General Manager or VP Torrance, CARequired education')))
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
Dave Is AFK Right Now! Cool
General Manager or VP Torrance, CA Required education