note 105271 added to function.preg-match
| From: | itworkarounds at gmail dot com | Date: | Sat, 06 Aug 2011 09:11:26 +0000 |
| Subject: | note 105271 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182277@lists.php.net to get a copy of this message | ||
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
----
Server IP: 69.147.83.197
Probable Submitter: 95.180.200.222
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- https://master.php.net/note/edit/105271
Del: integrated -- https://master.php.net/note/delete/105271/integrated
Del: useless -- https://master.php.net/note/delete/105271/useless
Del: bad code -- https://master.php.net/note/delete/105271/bad+code
Del: spam -- https://master.php.net/note/delete/105271/spam
Del: non-english -- https://master.php.net/note/delete/105271/non-english
Del: in docs -- https://master.php.net/note/delete/105271/in+docs
Del: other reasons-- https://master.php.net/note/delete/105271
Reject -- https://master.php.net/note/reject/105271
Search -- https://master.php.net/manage/user-notes.php