Skip to content

Instantly share code, notes, and snippets.

@kgleeson
Created January 12, 2012 14:30
Show Gist options
  • Save kgleeson/1600833 to your computer and use it in GitHub Desktop.
Save kgleeson/1600833 to your computer and use it in GitHub Desktop.
Find phone numbers in a file given as a command line argument
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