note 105271 deleted from function.preg-match by thiago
| From: | thiago@php.net | Date: | Sun, 07 Aug 2011 00:38:28 +0000 |
| Subject: | note 105271 deleted from function.preg-match by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182290@lists.php.net to get a copy of this message | ||
Note Submitter: itworkarounds at gmail dot com
----
You can match Cyrillic or other non Latin character with the following pattern:
<?php
preg_match("/^[a-zA-Z\p{Cyrillic}0-9\s\-]+$/u", "ABC abc 1234 ÐÐÐ
абв");
?>
See the full example here:
http://itworkarounds.blogspot.com/2011/08/validating-cyrillic-utf8-alphanumeric.html