JavaScript 1.2 has a powerful regexp () object that can be used to perform a matching operation of regular expressions. The test () method can verify that there is a match mode in the target object and return TRUE or FALSE accordingly.
We can write the following script using JavaScript to verify the validity of the mail address entered by the user.