Created
November 8, 2011 20:28
-
-
Save JustinAzoff/1349073 to your computer and use it in GitHub Desktop.
Generate a case insensitive regex for bro
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
#!/usr/bin/env python | |
import sys | |
phrase = sys.argv[1] | |
parts = [l + l.upper() for l in phrase.lower()] | |
regex = ''.join(['[%s]' % part for part in parts]) | |
print regex |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment