I was trying to understand about validating email in the following link - http://www.w3schools.com/PHP/php_form_url_email.asp
I know that \w means alphanumeric characters i.e. [0-9a-zA-Z] and - should mean to include a "-" as well. I got confused because they have used it after the "." as well, I think that after "." only alphanumeric characters can appear such as "com" , "org" etc.
\w explained
\w match any word character [a-zA-Z0-9_]
\w\- explained
\w\-
\w match any word character [a-zA-Z0-9_]
\- matches the character - literally
\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}\b
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments