Skip to content

Instantly share code, notes, and snippets.

@CodersArts
Created August 26, 2019 15:22
Show Gist options
  • Save CodersArts/cd5798e32be23354b3d90a8fb9da0091 to your computer and use it in GitHub Desktop.
Save CodersArts/cd5798e32be23354b3d90a8fb9da0091 to your computer and use it in GitHub Desktop.
split() regular expression in python
import re
s = "HELLO there HOW are YOU"
l = re.compile("(?<!^)\s+(?=[A-Z])(?!.\s)").split(s)
print l
Output:
['HELLO there', 'HOW are', 'YOU']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment