Last active
December 27, 2015 20:49
-
-
Save mattjbarlow/7387555 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
re.compile( | |
''' | |
(\d{3}) # Search for 3 digits and group them. | |
\D* # Followed by 0 or more non digit characters. | |
(\d{3}) # Followed by 3 digits grouped. | |
\D* # Followed by 0 or more non digit characters. | |
(\d{4}) # Followed by 4 digits grouped. | |
\D* # Followed by 0 or more non digit characters. | |
(\d*)$ # Followed by 0 or more digits until the end of the string. | |
''', | |
re.UNICODE | re.VERBOSE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment