([a-zA-Z0-9_-]+)(\@)([a-zA-Z0-9_-]+)(\.)([a-zA-Z0-9]{2,4})(\.[a-zA-Z0-9]{2,4})?
php preg_match
/([a-zA-Z0-9_-]+)(\@)([a-zA-Z0-9_-]+)(\.)([a-zA-Z0-9]{2,4})(\.[a-zA-Z0-9]{2,4})?/i
@mycollege.edu
^([a-zA-Z0-9_-]+)(@mycollege.edu)$
php preg_match
/^([a-zA-Z0-9_-]+)(@mycollege.edu)$/i
PHP CODE
<?php
$email = 'tahir_aS-adov@mycollege.edu';
preg_match('/^([a-zA-Z0-9_-]+)(@mycollege.edu)$/i', $email, $matches);
if ($matches) {
echo "Matched";
} else {
echo "Not Matched";
}
var_dump($matches);