-3

i want to validate following email id

email@-domain.com

for that i am using following regex but it is not validating above email id , what type of change in my current regex works for me

here is my regex

 /^[A-Za-z0-9_\+-]+(\.[A-Za-z0-9_\+-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.([A-Za-z]{2,10})$/
Chitra Nandpal
  • 413
  • 4
  • 24

1 Answers1

-1
^[a-zA-Z0-9_.+-]+@[-](?:(?:[a-zA-Z0-9-]+\.)?[a-zA-Z]+\.)?(domain|domain2)\.com$

or

/^[a-zA-Z0-9_.+-]+@[-][a-zA-Z0-9]{2,15}[.][a-zA-Z]{2,5}/g 

try this for email@-domail.com

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
pankaj jha
  • 41
  • 2