Quantcast
Channel: How can I validate an email address using a regular expression? - Stack Overflow
Browsing all 89 articles
Browse latest View live

Answer by Tim Wißmann for How can I validate an email address using a regular...

For my purpose, I needed a way to also extract a display name if provided.Thanks to the other answers and the regex provided on https://emailregex.com/ I came up with the following...

View Article


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

Yet another option we have is to use DataAnnotations which has an EmailAddressAttribute. This can not only be applied to the property of a class but can also leveraged at runtime.using...

View Article


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

Regex that I use:[\w-+]+([.][\w]+)?@[\w-+]+([.][a-z]{2,})+

View Article

Answer by alejandro juarez for How can I validate an email address using a...

If you need a simple form to validate, you can use the answer of https://regexr.com/3e48o^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$let r = new RegExp(String.raw `^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$`);//should be...

View Article

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

This simple pattern works for me:^(?<name>[^<>#()\.,;\s@\"]{1,})@(?<domain>[^<>#()\.,;\s@\"]{2,}\.(?<top>[^<>#()\.,;:\s@\"]{2,}))$

View Article


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

The regular expression for an email address is:/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t...

View Article

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

Maybe the best:/^[a-zA-Z0-9]+([-._][a-zA-Z0-9]+)*@[a-zA-Z0-9]+([-.][a-zA-Z0-9]+)*\.[a-zA-Z]{2,7}$/Start with a letter or number. It may include "-_ .", end with "." and less than seven characters (such...

View Article

Answer by Asad Ali Choudhry for How can I validate an email address using a...

Although very detailed answers are already added, I think those are complex enough for a developer who is just looking for a simple method to validate an email address or to get all email addresses...

View Article


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

Writing a regular expression for all the things will take a lot of effort. Instead, you can use pyIsEmail package.Below text is taken from pyIsEmail website.pyIsEmail is a no-nonsense approach for...

View Article


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

Email regex (RFC...

View Article

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

For Angular2 / Angular7 I use this pattern:emailPattern = '^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+[.]+[a-zA-Z0-9-.]+(\\s)*';private createForm() { this.form = this.formBuilder.group({ email: ['',...

View Article

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

I use this;^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$

View Article

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

According to RFC 2821 and RFC 2822, the local-part of an email addresses may use any of these ASCII characters: Uppercase and lowercare lettersThe digits 0 through 9 The characters,...

View Article


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

I converted the code into Java to match the compilerString pattern...

View Article

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

Just about every RegEx I've seen - including some used by Microsoft will not allow the following valid email to get through : simon-@hotmail.comJust had a real customer with an email address in this...

View Article


Answer by Prassd Nidode for How can I validate an email address using a...

List itemI use this function function checkmail($value){ $value = trim($value); if( stristr($value,"@") && stristr($value,".") && (strrpos($value, ".") - stripos($value, "@") > 2)...

View Article

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

For me the right way for checking emails is:Check that symbol @ exists, and before and after it there are some non-@ symbols: /^[^@]+@[^@]+$/Try to send an email to this address with some "activation...

View Article


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

I found a nice article, which says that the best way to validate e-mail address is the regular expression /.+@.+\..+/i.

View Article

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

I did not find any that deals with a top-level domain name, but it should be considered.So for me the following...

View Article

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

The HTML5 spec suggests a simple regex for validating email...

View Article
Browsing all 89 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>