Created
July 25, 2012 14:51
-
-
Save gionn/3176576 to your computer and use it in GitHub Desktop.
Email Regexp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# URL that generated this code: | |
# http://txt2re.com/[email protected]&1 | |
$txt='[email protected]'; | |
$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