note 95827 added to ref.pcre
| From: | cebelabatgmaildotcom at osu1 dot php dot net | Date: | Sun, 24 Jan 2010 06:41:20 +0000 |
| Subject: | note 95827 added to ref.pcre | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165249@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/ref.pcre.php
Edit -- https://master.php.net/note/edit/95827
Del: integrated -- https://master.php.net/note/delete/95827/integrated
Del: useless -- https://master.php.net/note/delete/95827/useless
Del: bad code -- https://master.php.net/note/delete/95827/bad+code
Del: spam -- https://master.php.net/note/delete/95827/spam
Del: non-english -- https://master.php.net/note/delete/95827/non-english
Del: in docs -- https://master.php.net/note/delete/95827/in+docs
Del: other reasons-- https://master.php.net/note/delete/95827
Reject -- https://master.php.net/note/reject/95827
Search -- https://master.php.net/manage/user-notes.php