Re: RegEx to check for non-Latin characters
| From: | Behzad | Date: | Sat, 15 Nov 2008 19:34:39 +0000 |
| Subject: | Re: RegEx to check for non-Latin characters | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-283322@lists.php.net to get a copy of this message | ||
Thanks everyone. I guess I find the answer:
* // return true if the $str ONLY consists of Arabic characters and
space-character
public function isArabicString($str)
{
return preg_match('/^([\p{Arabic}]|\s)*$/u', $str);
}
*
PHP 5.1.x or higher is required.
@see: http://www.regular-expressions.info/unicode.html
Cheers,
-b