note 105266 deleted from function.preg-match by danbrown

From: Date: Fri, 05 Aug 2011 20:24:39 +0000
Subject: note 105266 deleted from function.preg-match by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-182271@lists.php.net to get a copy of this message
Note Submitter: itworkarounds at gmail dot com ---- You can use the following pattern to match Cyrillic characters $str="ABC abc 1234 АБВ абв"; $pattern = "/^[a-zA-Z\p{Cyrillic}0-9\s\-]+$/u"; $result = (bool) preg_match($pattern, $str); if($result) echo "$str is composed of Cyrillic and alphanumeric characters\n"; see the following post for more examples: http://itworkarounds.blogspot.com/2011/08/validating-cyrillic-utf8-alphanumeric.html

« previous php.notes (#182271) next »