Created
December 9, 2015 17:02
-
-
Save natereed/ad81589dc081c9eb2342 to your computer and use it in GitHub Desktop.
Make a regex from an input string
This file contains 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 | |
text = '''Information to be included in statements filed | |
pursuant to Rule 13d-1 (b) (c) and (d) and Amendments thereto | |
filed pursuant to Rule 13d-2 (b).''' | |
text = text.replace('(', '\(') | |
text = text.replace(')', '\)') | |
text = re.sub(r'\s+', '\s+', text) | |
text = re.sub(r'\.', '\.', text) | |
print text | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment