Home > front end >  Beginners js
Beginners js

Time:10-28

Determine whether an E-mail format is correct, currently only learned with primer, many advanced all don't understand, ask for advice

CodePudding user response:

 
Var STR="[email protected]".
If (/^ [a zA - Z0 - _ - 9] + @ [a zA - Z0 - _ - 9] + (\. [a zA - Z0 - _ - 9] +) + $/. The test (STR)) {
Alert (" mail format right ");
} else {
Alert (" email format error ");
}

CodePudding user response:

I haven't learned that if you the inside of the content, I am struggling with how to use a for loop to find out the number of the ". "mailbox

CodePudding user response:

If the is a regular expression, there is no this what are you going to how to judge?

CodePudding user response:

Our teacher made several steps, first determine length, and then look at the number and position of the @ symbol, then judge. The number and position,
  • Related