[pcre-dev] contradicting perl sematics

Páxina inicial
Borrar esta mensaxe
Autor: Bernie Redman
Data:  
Para: pcre-dev
Asunto: [pcre-dev] contradicting perl sematics
Sorry to email directly but I am loathe to create a login account in order to file a bug report. Captchas would be appreciated, but I digress.The following code in perl would match:"qwe" =~ /w/However, the PCRE library, if constructing a regex from the string "w" reads it as "^w$" implicitly, whereas perl treats it as "^.*w.*$" implicitly.


      From ph10@??? Wed Oct 08 09:30:13 2008
Envelope-to: pcre-dev@???
Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]:52491)
    by tahini.csx.cam.ac.uk with esmtp (Exim 4.69)
    (envelope-from <ph10@???>) id 1KnUQu-0004KO-Fn
    for pcre-dev@???; Wed, 08 Oct 2008 09:30:12 +0100
X-Cam-AntiVirus: no malware found
X-Cam-SpamDetails: not scanned
X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/
Received: from demon-gw.quercite.com ([83.104.196.193]:50253
    helo?ercite.quercite.com)
    by ppsw-0.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.150]:587)
    with esmtpsa (PLAIN:ph10) (TLSv1:DHE-RSA-AES256-SHA:256)
    id 1KnUQu-0003pi-0s (Exim 4.70)
    (return-path <ph10@???>); Wed, 08 Oct 2008 09:30:12 +0100
Date: Wed, 8 Oct 2008 09:30:07 +0100 (BST)
From: Philip Hazel <ph10@???>
To: Meir Yanovich <meiry242@???>
In-Reply-To: <c30def490810071446n2f3e13bm3cfe74e556d86975@???>
Message-ID: <Pine.LNX.4.64.0810080928430.9230@???>
References: <c30def490810071446n2f3e13bm3cfe74e556d86975@???>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset?-ASCII
X-Spam-Score: -2.5 (--)
X-Spam-Status: No, score?.5 required~0 tests?L_TRUSTED?.8, AWL?.748,
    BAYES_00?.5,
    DNS_FROM_SECURITYSAGE>513 autolearnO version^1.8
Cc: pcre-dev@???
Subject: Re: [pcre-dev] how can i preform global match on string ?
X-BeenThere: pcre-dev@???
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: pcre-dev@???
List-Id: PCRE Development <pcre-dev.exim.org>
List-Unsubscribe: <http://lists.exim.org/mailman/listinfo/pcre-dev>,
    <mailto:pcre-dev-request@exim.org?subject?subscribe>
List-Archive: <http://lists.exim.org/lurker/list/pcre-dev.html>
List-Post: <mailto:pcre-dev@exim.org>
List-Help: <mailto:pcre-dev-request@exim.org?subject?lp>
List-Subscribe: <http://lists.exim.org/mailman/listinfo/pcre-dev>,
    <mailto:pcre-dev-request@exim.org?subject?bscribe>
X-List-Received-Date: Wed, 08 Oct 2008 08:30:13 -0000


On Tue, 7 Oct 2008, Meir Yanovich wrote:

> im trying to read the manual but i can't find any whare how can i do
> global match in a string
> like the perl \g flag


You have to write the loop yourself. There is some sample code in the
pcredemo.c source file.

Philip

--
Philip Hazel