Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63759 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5385 invoked from network); 6 Nov 2012 10:17:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Nov 2012 10:17:37 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.42 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.220.42 mail-pa0-f42.google.com Received: from [209.85.220.42] ([209.85.220.42:32933] helo=mail-pa0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/94-59729-0C3E8905 for ; Tue, 06 Nov 2012 05:17:37 -0500 Received: by mail-pa0-f42.google.com with SMTP id fa1so215812pad.29 for ; Tue, 06 Nov 2012 02:17:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=lg5HfuyHUB2WbLcOdk5ThC9tFIoUJwFQ/3XobydtDro=; b=qCyJWno9AaM/9sSXovap+PenngsouC26PGF7PFUYzXNNj69Our3CsVxH/Uo+FG4lPU x7e216L3nWFT1FQvPajv/vveuHO6JWkPbLqG9msyQEPEe5RC4XtF9coFiBgd4pAP/oqK Ip1vjAVD9S8jXhJCZ+fYBYIvJ/Thwqei68WWB8R2J+eqAufXMtQ3J/oNCuNkMDjSNnPL wM1ddBfp8ec8mBcUyt7fDZCYtqiZrfqDzsmxJkOeAV5cSn+ck0CVLi7JzFoP8NZ6Z04V +xgnYiJeiOPTCZJrQ39SXI9jH+SiPp1hC6rVUNDTMEUH8RFAfpbz8Gz5u2OjkePO1mUN y/JA== MIME-Version: 1.0 Received: by 10.66.80.66 with SMTP id p2mr1118476pax.84.1352197054382; Tue, 06 Nov 2012 02:17:34 -0800 (PST) Received: by 10.66.235.2 with HTTP; Tue, 6 Nov 2012 02:17:34 -0800 (PST) In-Reply-To: <5fce29a0cb5467c00eeb267dd38fd788@localhost> References: <5fce29a0cb5467c00eeb267dd38fd788@localhost> Date: Tue, 6 Nov 2012 11:17:34 +0100 Message-ID: To: =?ISO-8859-1?Q?Jean=2DS=E9bastien_Hedde?= Cc: internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Incomprehension with preg_match and utf8 From: pierre.php@gmail.com (Pierre Joye) hi, On Mon, Nov 5, 2012 at 10:57 AM, Jean-S=E9bastien Hedde wrote: > Hi, > > I'm facing an issue with preg_match and an UTF8 string. > > The pattern is : /^[[:alnum:]\s\-\'%]+$/u > The string : R=E9gis > > If I read the manual preg_match should return 0 ("In UTF-8 mode, characte= rs > with values greater than 128 do not match any of the POSIX character > classes.") but I've got 1 in some case : > > On a Windows host > php 5.2.12 - (PCRE 7.9 2009-04-11) : preg_match =3D=3D=3D 1 > > On the same centos host : > php 5.2.10 (R=E9mi's RPM) - (PCRE 6.6 06-Feb-2006) : preg_match =3D=3D=3D= 0 > php 5.4.8 (my build) - (PCRE 8.12 2011-01-15) : preg_match =3D=3D=3D 1 > > On an other Centos host : > php 5.4.0 (R=E9mi's RPM) - (PCRE 7.8 2008-09-05) > > How this can be possible ? 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. Cheers, -- Pierre @pierrejoye