Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63760 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6713 invoked from network); 6 Nov 2012 10:18:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Nov 2012 10:18:51 -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.210.42 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.210.42 mail-da0-f42.google.com Received: from [209.85.210.42] ([209.85.210.42:43388] helo=mail-da0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/E4-59729-A04E8905 for ; Tue, 06 Nov 2012 05:18:51 -0500 Received: by mail-da0-f42.google.com with SMTP id z17so131939dal.29 for ; Tue, 06 Nov 2012 02:18:48 -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=nR6gc4l5vl0BGwiVV71Wjfqerg/3CFFGan/44pV7kXU=; b=wb0TMUFrmNPpDWxZ2NsOV8gP8W++2aDDOlpQjLm2a8lYo8MnB1CCyDFZ6eoKJbGhsR RgijKQZWQv68cWqQO0t3Zt0WzaVPVK8wE8t/nfBbAK+d2YvuI8dL6mP5EdCGYlYmVLPB sKFwYLZQ/bZf8FJOX1aG29y6T17hqjaKn5jaos+nyYGFe4Rwb7MRqrYnPV+zfHXRWhIc HX5M4mGhCV4OvP+Nlp10JymA7OIyDaKTsAYZJp1s0iZP3aXh4shroswGj8m4fxgZMg0R c0jcCLGxxQamsZirDl6j0/5OlDLSKgEXyMJPEMmlMSGP+qjF1C28RmfxVTkClPYawzT0 ES/A== MIME-Version: 1.0 Received: by 10.66.80.66 with SMTP id p2mr1126198pax.84.1352197128169; Tue, 06 Nov 2012 02:18:48 -0800 (PST) Received: by 10.66.235.2 with HTTP; Tue, 6 Nov 2012 02:18:48 -0800 (PST) In-Reply-To: References: <5fce29a0cb5467c00eeb267dd38fd788@localhost> Date: Tue, 6 Nov 2012 11:18:48 +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) On Tue, Nov 6, 2012 at 11:17 AM, Pierre Joye wrote: > 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, charact= ers >> 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 builtin pcre (btw, forget 5.2, go with at least 5.3). >> 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 system's pcre >> php 5.4.8 (my build) - (PCRE 8.12 2011-01-15) : preg_match =3D=3D=3D 1 builtin pcre >> On an other Centos host : >> php 5.4.0 (R=E9mi's RPM) - (PCRE 7.8 2008-09-05) system's pcre Cheers, -- Pierre @pierrejoye