You may use the following regular expression: /^[a-zA-Z0-9_-+ t/@%.]+$/ For example: return (preg_match('/^[a-zA-Z0-9_-+ t/@%.]+$/', $str);
<< Go back