Re: Incomprehension with preg_match and utf8
| From: | Gustavo Lopes | Date: | Mon, 05 Nov 2012 10:32:57 +0000 |
| Subject: | Re: Incomprehension with preg_match and utf8 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-63741@lists.php.net to get a copy of this message | ||
Em 2012-11-05 10:57, Jean-Sébastien Hedde escreveu:
I'm facing an issue with preg_match and an UTF8 string. The pattern is : /^[[:alnum:]\s\-\'%]+$/u The string : Régis If I read the manual preg_match should return 0 ("In UTF-8 mode, characters with values greater than 128 do not match any of the POSIX character classes.") but I've got 1 in some case :The documentation is simply out-of-date. We have set PCRE_UCP if the 'u' modifier is present for some time now (since 87a237342, 3 Oct 2010). Look for PCRE_UCP in http://www.pcre.org/pcre.txt to know the implications. -- Gustavo Lopes