Re: [PHP] RegEx to check for non-Latin characters

2008-11-15 Thread Richard Heyes
For a Form Validation process, I need a function to avoid Latin characters to be provided as the first or last name. Since we expect our users to enter their personal info in Persian. Do you know any regular expression to provide this functionality? 1) Regex to check whether there are Latin

Re: [PHP] RegEx to check for non-Latin characters

2008-11-15 Thread Yeti
Hi Behzad, I would try a different approach ... EXAMPLE (UTF-8): !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 /

Re: [PHP] RegEx to check for non-Latin characters

2008-11-15 Thread Behzad
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:

[PHP] RegEx to check for non-Latin characters

2008-11-14 Thread Behzad
Dear List, For a Form Validation process, I need a function to avoid Latin characters to be provided as the first or last name. Since we expect our users to enter their personal info in Persian. Do you know any regular expression to provide this functionality? 1) Regex to check whether there are