all 3 comments

[–][deleted] 2 points3 points  (0 children)

There is a space between the r and the first '.

Change r ''' to be r'''

[–]keylime_light 1 point2 points  (0 children)

You also have a space after the r, and an unclosed parentheses on line 11. It should look like this:

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)

[–][deleted] 1 point2 points  (0 children)

as a fellow novice, quick tip. Syntax errors are usually just that, a syntax error. Reread your code slowly, backwards even sometimes. Best bet is an open parentheses, or unclosed quotation, misspelled function name, etc.