One step closer to world domination
Posts tagged regular expressions
Simple Reg-Ex to Validate an Email Address
Nov 24th
Regular expressions can be a pain sometimes. Here’s a code snippet to make your life a little easier when validating email addresses:
$email = 'user@example.com'; if (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$", $email)) { print_error("Your email address is invalid!"); }










