I'm trying to build a simple validator that will match [email protected] but not John@gmailcom or Johngmail.com - it must contain both @ and .
I am using this - /[@.]/g but it matches and tests when only one of these characters are matched.
Is there a better method of doing this?
^[[email protected]]{14}$(I assumed chars can be shuffled because else that would be a strict equality withtout the neeed of a regexp)/(?=.*@.*\.).+/g@.happen to be valid e-mail either.[email protected], fourteen times, when OP was only talking about@and.. And your explanation wasn't there as well. I'll just remove my comment, sorry for the trouble.