🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #161535

[Xnews] PCRE question

#161535
From: »Q«
Date: Sat, 29 Jan 2005 00:38
29 lines
2205 bytes
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.

-- 
»Q«
     links to Xnews resources:
     <http://www.cotse.net/users/putty/help.htm>
Technical Details
Message-ID: <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.ams.giganews.com!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border1.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <MrQ9602BD05FD0F0itsmeitsQ@QsFQDN.dyndns.org>
Subject: [Xnews] PCRE question
Date: Sat, 29 Jan 2005 00:38:28 +0000
From: »Q« <boxcars@gmx.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.ams.giganews.com!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border1.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
Newsgroups: news.software.readers
Organization: we don't need no stinkin' organization
Lines: 29
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: individual.net zkCLc/EsPMWunTEtw/IR5gArl/2V8r9TA3PAgP0inIUlfVw7xr
X-Orig-X-Complaints-To: <http://www.cybergecko.com/complain.htm>
X-Face: *#`F(_&o, GRH~~$V&ByU1LZAWc]JgxuT`Pv2y0`&JE`(=*PcC>#m2]xv]p,
 i|9mDJ+8dGMJl`V[!z]\N}qrLTHjU]Sew>rQBShT_8.(0Q(iH,
 Gu7k|y/)^!@oVydVrix*#|-|u2~zgA'U3nQ_fa#jXvcGL[9f:>8?U=hXYK3D~*}Gq$TjPe1WXEFLGTiB3ot!oMH"'(Jop0(\0C