Created
February 22, 2017 15:09
-
-
Save codelingoblog/b0e6649052f46ea50041c6b7c71321a5 to your computer and use it in GitHub Desktop.
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 | |
# regex to match Washington D.C phone numbers | |
regex = r"\b202\-\d{3}\-\d{4}" | |
file = open("phone_numbers.txt", "r") | |
phonenumbers = file.read() | |
print(re.findall(regex, phonenumbers)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment