Skip to content

Instantly share code, notes, and snippets.

@gionn
Created July 25, 2012 14:51
Show Gist options
  • Save gionn/3176576 to your computer and use it in GitHub Desktop.
Save gionn/3176576 to your computer and use it in GitHub Desktop.
Email Regexp
<?php
# URL that generated this code:
# http://txt2re.com/index-php.php3?s=remember@me.com&1
$txt='remember@me.com';
$re1='([\\w-+]+(?:\\.[\\w-+]+)*@(?:[\\w-]+\\.)+[a-zA-Z]{2,7})'; # Email Address 1
if ($c=preg_match_all ("/".$re1."/is", $txt, $matches))
{
$email1=$matches[1][0];
print "($email1) \n";
}
#-----
# Paste the code into a new php file. Then in Unix:
# $ php x.php
#-----
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment