Created
January 12, 2012 14:30
-
-
Save kgleeson/1600833 to your computer and use it in GitHub Desktop.
Find phone numbers in a file given as a command line argument
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 | |
import sys | |
with open(sys.argv[1]) as f: | |
text = f.read() | |
numberRE = re.compile('08[3-8][0-9]{7}') | |
for w in numberRE.findall(text): | |
print w |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment