Posted By

aristoworks on 07/01/08


Tagged

email php validation regular expressions address


Versions (?)

Who likes this?

10 people have marked this snippet as a favorite

JimiJay
vince2doom
jdstraughan
DeathfireD
robe
benpjohnson
vali29
symulacra
kitsched
Nikush


PHP (RegEx) Email Address Validation


 / Published in: PHP
 

URL: http://www.thejwalker.com

A simple method of validating an email address using PHP and regular expressions

  1. $string = "[email protected]";
  2. '/^[^\W][a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)*\@[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)*\.[a-zA-Z]{2,4}$/',
  3. $string)) {
  4. echo "example 3 successful.";
  5. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Nikush on October 7, 2010

Very accurate, thanks!

You need to login to post a comment.