Skip to content

Instantly share code, notes, and snippets.

@harveytoro
Last active December 16, 2015 04:09
Show Gist options
  • Save harveytoro/5375142 to your computer and use it in GitHub Desktop.
Save harveytoro/5375142 to your computer and use it in GitHub Desktop.
^([a-z0-9\.\-\+\_]+)@[a-z0-9\-\+\_]+\.[a-z0-9\-\+\_]*(\.?)[a-z0-9]+$
<?php
$pattern = "/^([a-z0-9\.\-\+\_]+)@[a-z0-9\-\+\_]+\.[a-z0-9\-\+\_]*(\.?)[a-z0-9]+$/";
$input = "";
if (preg_match($pattern, $input)) {
//matches
} else {
//doesn't match
}
?>
^http://[a-z0-9\-\.]+\.[a-z]*(\.?)[a-z]+$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment