Regular expression to verify email address

WBOY
Release: 2016-07-25 08:45:33
Original
1109 people have browsed it
  1. $email = "test@ansoncheung.com";
  2. if (preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0- 9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$ /',$email)) {
  3. echo "Your email is ok.";
  4. } else {
  5. echo "Wrong email address format";
  6. }
Copy code

Regular expression, email


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template