Possible Duplicate:
Regex, get string value between two characters
What is the pattern to get what's between '@' and '.' in this string? In this case it would get 'gmail'.
Possible Duplicate:
Regex, get string value between two characters
What is the pattern to get what's between '@' and '.' in this string? In this case it would get 'gmail'.
$email = '[email protected]';
$gmail = preg_match('/@([^\.]*)\./', $email, $m) ? $m[1] : false;