regular expression to detect numbers written as words - UTF-8 input
问题 thanks for the answers to : "regular expression to detect numbers written as words" : regular expression to detect numbers written as words I now have this working, however I have the same requirement but the numbers as words are in Arabic (or any other UTF-8) and not English, so : if (preg_match("/\p{L}\b(?:(?:واحد|اثنان|ثلاثة|أربعة|خمسة|ستة|سبعة|ثمانية|تسعة|صفر|عشرة)\b\s*?){4}/", $str, $matches) > 0) return true; Does not work - I've googled and there seems to be quite a few issues with