note 95828 added to function.preg-match
| From: | cebelabatgmaildotcom at osu1 dot php dot net | Date: | Sun, 24 Jan 2010 06:43:07 +0000 |
| Subject: | note 95828 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165250@lists.php.net to get a copy of this message | ||
I noticed that in order to deal with UTF-8 texts, without having to recompile php with the PCRE
UTF-8 flag enabled, you can just add the following sequence at the start of your pattern: (*UTF8)
for instance : '#(*UTF8)[[:alnum:]]#' will return TRUE for 'é' where
'#[[:alnum:]]#' will return FALSE
found this very very useful tip after hours of research over the web directly in pcre website right
here : http://www.pcre.org/pcre.txt
there are many further informations about UTF-8 support in the lib
hop that will help!
--
cedric
----
Server IP: 69.147.83.197
Probable Submitter: 80.125.165.184
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- https://master.php.net/note/edit/95828
Del: integrated -- https://master.php.net/note/delete/95828/integrated
Del: useless -- https://master.php.net/note/delete/95828/useless
Del: bad code -- https://master.php.net/note/delete/95828/bad+code
Del: spam -- https://master.php.net/note/delete/95828/spam
Del: non-english -- https://master.php.net/note/delete/95828/non-english
Del: in docs -- https://master.php.net/note/delete/95828/in+docs
Del: other reasons-- https://master.php.net/note/delete/95828
Reject -- https://master.php.net/note/reject/95828
Search -- https://master.php.net/manage/user-notes.php