/    Sign up×
Community /Pin to ProfileBookmark

Need a comprehensive e-mail validation check.

I need a comprehensive e-mail validation check.
Anyone willing to share a good one?
Mine seems to be failing on some valid addresses.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@jeffmottJun 14.2003 — I'm assuming you mean syntax checking...[size=2]/^[^x00-x20()<>@,;:\".[]x7f-xff]+(?:.[^x00-x20()<>@,;:\".[]x7f-xff]+)*@[^x00-x20()<>@,;:\".[]x7f-xff]+(?:.[^x00-x20()<>@,;:\".[]x7f-xff]+)+$/[/size]This is derived from RFC822: Standard for ARPA Internet Text Messages. However, when this regex was first introduced on this forum it was generally consented that it was too laxed. The two places where the pattern above deviates from the specification are:

( local-part "@" domain )

  • 1. The specification for the local-part allows the special characters that are normally not allowed if it is quoted. So for instance, [font=courier new]":sysmail"@Some-Group.Some-Org[/font] would be a valid address but be rejected by the above regex.


  • 2. The above pattern requires at least one period followed by at least one other valid character in the domain. However, the specification does not require any period to be present in the domain. For example, [font=courier new]emladdr@localhost[/font] is a valid address, but would be rejected by the above pattern.


  • These are the only two places where the rx does not return what it technically should. However, these situations rarely arise. I personally have [i]never[/i] seen either type of address. So odds are good you will never encounter problems with them.
    Copy linkTweet thisAlerts:
    @gsbauthorJun 14.2003 — Thanks.

    I'll give it a try.
    ×

    Success!

    Help @gsb spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.6,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...