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 ". "mailboxCodePudding 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,