Regular expression syntax error

Discussion in 'Python' started by Vargles, Dec 20, 2015.

  1. Vargles

    Vargles

    Joined:
    Dec 20, 2015
    Messages:
    2
    Likes Received:
    0
    Hi, I'm fairly new to python and am having an issue with with syntax. My code is:

    Code (Text):
    # CREATE EMAIL REGEX
    email.Regex = re.compile(r'''(
    [a-zA-Z0-9._%+-]+.       #username
    @                                   #@ symbol
    [a-zA-Z0-9._%+-]+.       #domain name
    (\.[a-zA-Z]{2,4}.            # dot something
    )''', re.VERBOSE)
    I'm receiving the error:
    Code (Text):

    line 28
    emailRegex = re.compile(r'''(
                       ^
    SyntaxError: invalid syntax
     
    I'm not quite sure what it is I've done wrong.
    Python version is 2.7.9
     
    Last edited: Dec 20, 2015
    Vargles, Dec 20, 2015
    #1
    1. Advertisements

  2. Vargles

    Vargles

    Joined:
    Dec 20, 2015
    Messages:
    2
    Likes Received:
    0
    The carot is pointing to the "x" in emailRegex, by the way.
     
    Vargles, Dec 20, 2015
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. VSK
    Replies:
    2
    Views:
    2,799
  2. Sreedhar Vankayala
    Replies:
    2
    Views:
    936
    Sreedhar Vankayala
    Dec 4, 2004
  3. pekka niiranen
    Replies:
    5
    Views:
    891
    Paul McGuire
    Oct 20, 2004
  4. Johann C. Rocholl
    Replies:
    1
    Views:
    502
    Diez B. Roggisch
    Feb 4, 2005
  5. Ernesto

    Regular Expression Syntax Help

    Ernesto, Feb 7, 2006, in forum: Python
    Replies:
    4
    Views:
    447
    Raja Raman Sundararajan
    Feb 8, 2006
  6. seberino@spawar.navy.mil
    Replies:
    3
    Views:
    590
    BartlebyScrivener
    Nov 8, 2007
  7. Mark B
    Replies:
    8
    Views:
    1,074
    Jesse Houwing
    Apr 2, 2009
  8. Mark Richards
    Replies:
    3
    Views:
    601
    Tad McClellan
    Nov 18, 2007
Loading...