Here we create a Reg Exp pattern and use the match to validate it.
Recommend：php - Using a regular expression to validate an email addressil addresses correctly, assuming they don't use an IP address as the server part.
function email Validation() UPDATE 1 : Please use the regular expression shown below instead of the one above.
– meagar♦ Oct 11 '15 at Why can't you adapt it then?
If your HTML form accepts an email field, it is a good practice to validate the email before the form is submitted.
So the condition is we check whether the textbox contains anything ELSE other than numbers and display a message As you can see the function validate() checks if the entered string contains characters that does NOT (notice the ^ symbol) match the numbers 0 to 9 including white spaces and special characters.
From numbers we’ll move to alphabets first an example for validation lowercase alphabets and then to validate both uppercase and lowercase.