0

Hello i have following problem.

I found regexp expression for email validation like this :

 function isEmail(email) {
    var regex = /^([a-zA-Z0-9_.+-])+@(([a-zA-Z0-9-])+.)+?.+([a-zA-Z0-9]{2,4})+$/;
 return regex.test(email);
 }

It looked ok but when i type email address like this

asdasda@asdad

It is valid. Can someone help me why it is valid even without '.' -dot?

Thank You very much

Martin Fric
  • 726
  • 2
  • 9
  • 27
  • `^([a-zA-Z0-9_.+-])+@(([a-zA-Z0-9-])+.)+?\.([a-zA-Z0-9]{2,4})+$` Check [this](https://regex101.com/r/uN8tL3/1) – Tushar Nov 06 '15 at 08:18
  • 1
    It is a valid email. See [Email Wikipedia article, *Valid email addresses* section](https://en.wikipedia.org/wiki/Email_address). *admin@mailserver1 (local domain name with no TLD)*. – Wiktor Stribiżew Nov 06 '15 at 08:18
  • oh. But in my case there will be no local domain names. Can u help me with my case with . as a "must" – Martin Fric Nov 06 '15 at 08:24

0 Answers0