Article View: news.software.readers
Article #161537Re: [Xnews] PCRE question
From: me
Date: Sat, 29 Jan 2005 01:27
Date: Sat, 29 Jan 2005 01:27
36 lines
2217 bytes
2217 bytes
»Q« <boxcars@gmx.net> wrote in »news:MrQ9602BD05FD0F0itsmeitsQ@QsFQDN.dyndns.org: > I'm seeing an unexpected result in Xnews' regex tester when > a .* follows a lookbehind assertion. > > ISTM the regex (?<=foo).* should match the last three > letters of the string "foobar", but it doesn't. (?<=foo).+ > does result in a match. > > I've marked this [Xnews] only because I see the behavior > there, but it seems to happen with PCRE generally, and I > can't explain it. I'm hoping someone here can. > > I actually ran across it using GNU grep (v 2.5.1) with the > -P switch, which makes grep use libpcre instead of POSIX > regexes. > > $ echo foobar | grep -P "(?<=foo).*" > > results in no match. Both Xnews and grep are relying on > Philip Hazel's library. > > OTOH, with The Regex Coach, which uses a different engine > for Perl-compatible regex, the regex (?<=foo).* does match > the last three letters of "foobar", as I expected. > > Any thoughts/comments/explanations welcome. Especially > explanations. > Interesting. The tester matches (?<=foo)(.)* Explanation: better not from me - I wouldn't dare. ;). J -- Replies to: Nherr1professor2doktor31109(at)Oyahoo(dot)Tcom
Technical Details
Message-ID:
<Xns95ECD00E162D3metadyataminvalid@netnews.worldnet.att.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!wn13feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mailReferences:
<MrQ9602BD05FD0F0itsmeitsQ@QsFQDN.dyndns.org>Show Full Headers
Complete Article Headers
Message-ID: <Xns95ECD00E162D3metadyataminvalid@netnews.worldnet.att.net> Subject: Re: [Xnews] PCRE question Date: Sat, 29 Jan 2005 01:27:22 GMT From: me@tadyatam.invalid References: <MrQ9602BD05FD0F0itsmeitsQ@QsFQDN.dyndns.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!wn13feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: news.software.readers User-Agent: Xnews/06.12.01 X-No-Archive: yes Lines: 36 NNTP-Posting-Host: 12.76.163.153 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1106962042 12.76.163.153 (Sat, NNTP-Posting-Date: Sat, 29 Jan 2005 01:27:22 GMT Organization: AT&T Worldnet