1

I am using validate.js to validate the contact form.

It works fine but issue is email validation seems broken at some intervals

For eg: if email is abc@xyz , then it considers email valid but if email is abc@xyz. , then it considers email invalid

Can't it be like, i.e only consider email valid when [email protected]

Following is the regular expression being used

 /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value )

I have no idea about regular expressions. Please help.

Thanks

2

1 Answer 1

1

Use this: /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.