Re: [PHP-DEV] Incomprehension with preg_match and utf8

2012-11-08 Thread Remi Collet
Le 06/11/2012 11:17, Pierre Joye a écrit : php 5.2.10 (Rémi's RPM) - (PCRE 6.6 06-Feb-2006) : preg_match === 0 I would try using the bundled PCRE instead. As far as I remember, almost all distro uses the system PCRE and not always build with UTF-8 All my build use bundled pcre library when

Re: [PHP-DEV] Incomprehension with preg_match and utf8

2012-11-06 Thread Galen Wright-Watson
On Mon, Nov 5, 2012 at 8:54 PM, Philip Olson phi...@roshambo.org wrote: [...] A few simple/related facts: [...] - Gustavo mentioned the related PHP change on Oct 3, 2010 (not sure what PHP version, and googling for 87a237342 turns up empty, and I miss SVN version numbers) For

Re: [PHP-DEV] Incomprehension with preg_match and utf8

2012-11-06 Thread Pierre Joye
hi, On Mon, Nov 5, 2012 at 10:57 AM, Jean-Sébastien Hedde jean...@au-fil-du.net wrote: Hi, 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

Re: [PHP-DEV] Incomprehension with preg_match and utf8

2012-11-06 Thread Pierre Joye
On Tue, Nov 6, 2012 at 11:17 AM, Pierre Joye pierre@gmail.com wrote: On Mon, Nov 5, 2012 at 10:57 AM, Jean-Sébastien Hedde jean...@au-fil-du.net wrote: Hi, 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

Re: [PHP-DEV] Incomprehension with preg_match and utf8

2012-11-06 Thread Jean-Sébastien Hedde
On Tue, 6 Nov 2012 11:17:34 +0100, Pierre Joye pierre@gmail.com wrote: I would try using the bundled PCRE instead. As far as I remember, almost all distro uses the system PCRE and not always build with UTF-8 support. Hi, I come to this conclusion too but I don't see what is missing in

Re: [PHP-DEV] Incomprehension with preg_match and utf8

2012-11-06 Thread Felipe Pena
Hi guys, 2012/11/6 Philip Olson phi...@roshambo.org On Nov 5, 2012, at 8:55 AM, Rasmus Lerdorf wrote: On 11/05/2012 08:41 AM, Jean-Sébastien Hedde wrote: On Mon, 05 Nov 2012 08:04:06 -0800, Rasmus Lerdorf ras...@lerdorf.com wrote: I think the documentation is wrong on that. In

[PHP-DEV] Incomprehension with preg_match and utf8

2012-11-05 Thread Jean-Sébastien Hedde
Hi, 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

Re: [PHP-DEV] Incomprehension with preg_match and utf8

2012-11-05 Thread Gustavo Lopes
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

Re: [PHP-DEV] Incomprehension with preg_match and utf8

2012-11-05 Thread Rasmus Lerdorf
On 11/05/2012 01:57 AM, Jean-Sébastien Hedde wrote: Hi, 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

Re: [PHP-DEV] Incomprehension with preg_match and utf8

2012-11-05 Thread Jean-Sébastien Hedde
On Mon, 05 Nov 2012 08:04:06 -0800, Rasmus Lerdorf ras...@lerdorf.com wrote: I think the documentation is wrong on that. In Unicode mode [[:alnum:]] actually becomes \p{Xan} which should match Unicode chars as well, but only if PCRE was compiled with Unicode support. So I suspect you don't

Re: [PHP-DEV] Incomprehension with preg_match and utf8

2012-11-05 Thread Rasmus Lerdorf
On 11/05/2012 08:41 AM, Jean-Sébastien Hedde wrote: On Mon, 05 Nov 2012 08:04:06 -0800, Rasmus Lerdorf ras...@lerdorf.com wrote: I think the documentation is wrong on that. In Unicode mode [[:alnum:]] actually becomes \p{Xan} which should match Unicode chars as well, but only if PCRE was

Re: [PHP-DEV] Incomprehension with preg_match and utf8

2012-11-05 Thread Philip Olson
On Nov 5, 2012, at 8:55 AM, Rasmus Lerdorf wrote: On 11/05/2012 08:41 AM, Jean-Sébastien Hedde wrote: On Mon, 05 Nov 2012 08:04:06 -0800, Rasmus Lerdorf ras...@lerdorf.com wrote: I think the documentation is wrong on that. In Unicode mode [[:alnum:]] actually becomes \p{Xan} which should