Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- def is_phone_number(text):
- reg = re.compile("\d{3}[-]\d{3}[-]\d{4}")
- results = reg.findall(text)
- return results
- message = 'Call me at 415-555-1011 tomorrow. 415-555-9999 is my office.'
- for chunk in is_phone_number(message):
- print('Phone number found: ' + chunk)
- print('Done')
Advertisement
Add Comment
Please, Sign In to add comment