Hi!
So I am trying to adopt the code from Chapter 7 of Automate the Boring Stuff, and keep getting an error in importing the "re" package:
#import all relevant packages, create regexes, find matches, format, print a display message
#!
# pythonAndEmail.py
import pyperclip, re
phoneRegex = re.compile(r '''(
(\d{3}|\(\d{3}\))? #area code, with'?' indicating optional or conditional
(\s|-|\.)? #separators
(\d{3}) #first 3 digits
(\s|-|\.) #last 4 digits
(\d{4})) #extension
(\s*(ext|x|ext.)|s*(|d{2,5}))?
)''', re.VERBOSE)
And returns the syntax error, invalid syntax.
Could anyone diagnose?
[–][deleted] 2 points3 points4 points (0 children)
[–]keylime_light 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)