#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    21
    Rep Power
    0

    Thumbs up Email Validation


    Hiya
    Just wondering if someone can help me. Im looking at trying to validate emails in python 3. Basically the user enters their email and it has to be in the correct format. Any ideas how I even start this? The format would be something like fgh123@ikj123.lmn, it doesnt really matter I just need to know how to start this? Any help would be greatly appreciated.

    Thanks Nx
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,841
    Rep Power
    480
    I suppose you'd search the internet for a regular expression that matches valid email addresses, and then use that expression.

    import re
    match = re.compile(regular_expression).match
    #...
    if match(address):
    ok(address)
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo