Quantcast
Channel: How can I validate an email address using a regular expression? - Stack Overflow
Browsing index pages (90 articles)

Answer by cprcrack for How can I validate an email address using a regular...

If you are looking for a more practical implementation, this is the regex used by Postmark for email validation, based on...

View Article


Answer by danday74 for How can I validate an email address using a regular...

A generic email validation (to catch obvious errors, not all use cases) is here:/^[^@\s]+@[^@\s]+\.[^@\s]+$/I've found it to be the most reliable simple solutioncredit to:...

View Article


Answer by Mark Stewart for How can I validate an email address using a...

For oracle database, version 23+, there is a built-in Usage Domain name email_d which uses the regex^([a-zA-Z0-9!#$%&*+=?^_`{|}~-]+(\.[ A-Za-z0-9!#$%&*+=?^_`{|}~-]+)*)@(([...

View Article

Answer by bravo for How can I validate an email address using a regular...

We get a more practical implementation of RFC 5322 if we omit IP addresses, domain-specific addresses, the syntax using double quotes and square brackets. It will still match 99.99% of all email...

View Article

Answer by Thejaka for How can I validate an email address using a regular...

This answer largely and directly addresses multiple issues in the currently highest upvoted answer.This answer also reinterprets and optimizes the regex as used in WebKit for example, for the Email...

View Article


Answer by Aman Godara for How can I validate an email address using a regular...

if you are looking to check against a simple format: xxx@xxx.xxx or xxx.xxx@xxx.xxx/^[^.\s@]+(\.[^.\s@]+)*@[^.\s@]+(\.[^.\s@]+)+$/exact format used: ^x(.x)*@x(.x)+$x any non-empty string without...

View Article

Answer by amatinya for How can I validate an email address using a regular...

This is the best regular expression I've ever...

View Article

Answer by ThinkTrans for How can I validate an email address using a regular...

The question title is fairly generic, however the body of the question indicates that it is about the PHP based solution. Will try to address both.Generically speaking, for all programming...

View Article


Answer by Eggon for How can I validate an email address using a regular...

I'd like to propose my approach which is relatively simple while ensuring proper email structure and restricting forbidden characters. Valid for latin...

View Article


How can I validate an email address using a regular expression?

Over the years I have slowly developed a regular expression that validates most email addresses correctly, assuming they don't use an IP address as the server part.I use it in several PHP programs, and...

View Article

Answer by Per Hornshøj-Schierbeck for How can I validate an email address...

I use^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$Which is the one used in ASP.NET by the RegularExpressionValidator.

View Article

Answer by Chris Vest for How can I validate an email address using a regular...

I don't know about best, but this one is at least correct, as long as the addresses have their comments stripped and replaced with white space.Seriously. You should use an already-written library for...

View Article

Answer by Draemon for How can I validate an email address using a regular...

There are plenty examples of this out on the Internet (and I think even one that fully validates the RFC - but it's tens/hundreds of lines long if memory serves).People tend to get carried away...

View Article


Answer by Kon for How can I validate an email address using a regular...

I never bother creating with my own regular expression, because chances are that someone else has already come up with a better version. I always use regexlib to find one to my liking.

View Article

Image may be NSFW.
Clik here to view.

Answer by bortzmeyer for How can I validate an email address using a regular...

The fully RFC 822 compliant regex is inefficient and obscure because of its length. Fortunately, RFC 822 was superseded twice and the current specification for email addresses is RFC 5322. RFC 5322...

View Article


Answer by Andy Lester for How can I validate an email address using a regular...

It all depends on how accurate you want to be. For my purposes, where I'm just trying to keep out things like bob @ aol.com (spaces in emails) or steve (no domain at all) or mary@aolcom (no period...

View Article

Answer by PhiLho for How can I validate an email address using a regular...

There is not one which is really usable. I discuss some issues in my answer to Is there a PHP library for email address validation?, it is discussed also in Is regular expression recognition of an...

View Article


Answer by DOK for How can I validate an email address using a regular...

While deciding which characters are allowed, please remember your apostrophed and hyphenated friends. I have no control over the fact that my company generates my email address using my name from the...

View Article

Answer by adnam for How can I validate an email address using a regular...

Cal Henderson (Flickr) wrote an article called Parsing Email Addresses in PHP and shows how to do proper RFC (2)822-compliant email address parsing.You can also get the source code in PHP, Python, and...

View Article

Answer by JacquesB for How can I validate an email address using a regular...

This question is asked a lot, but I think you should step back and ask yourself why you want to validate email adresses syntactically? What is the benefit really?It will not catch common typos.It does...

View Article
Browsing index pages (90 articles)


Latest Images