0

hi i am using the regex to validate the email but when i try to user underscore in email address than is giving me the error.

Following is regx which i am using.

^[a-zA-Z0-9-'+~]+(.[a-zA-Z0-9-'+~]+)*@([a-zA-Z_0-9-]+.)+[a-zA-Z]{2,10}$

if (not isValid("regex", arguments.propertyValue,"^[a-zA-Z0-9-'\+~]+(\.[a-zA-Z0-9-'\+~]+)*@([a-zA-Z_0-9-]+\.)+[a-zA-Z]{2,10}$")) {
}

can any one please let me know which regx should i use?

Preet sohal
  • 29
  • 1
  • 6
  • Tons of variants, go check the 2 threads I linked to. Just a hint: `[a-zA-Z0-9-'\+~]+(\.[a-zA-Z0-9-'\+~]+)*` does not match a `_`. Why not add it inside `[...]`? – Wiktor Stribiżew Jun 14 '18 at 07:56
  • This question should be opened, as the correct answer is to not user a regex for validating email, but the builtin email validation. Ironically, that's isValid("email", "someemail@something.com") – Marcus Fernström Jun 18 '18 at 01:36

0 Answers0