From bengolding at fastmail.fm Mon Feb 16 16:33:00 2009 From: bengolding at fastmail.fm (Ben Golding) Date: Mon, 16 Feb 2009 16:33:00 +0000 Subject: [regex-coach] Feature req: possessive quantifier support (revisited) Message-ID: <1234801980.1846.1300669625@webmail.messagingengine.com> Hi all, I already checked the archives for this issue and it seems I am not the first to ask: http://common-lisp.net/pipermail/regex-coach/2005-April/000282.html The response from Edi at that time: "Standalone" regular expressions ("atomic grouping") as in (?>x+) are supported, possesive quantifiers as in x++ aren't because they aren't in Perl and CL-PPCRE tries to be compatible with Perl. That was in 2005. Indeed, using an older Perl: % perl -e "print 'no' if '123456' !~ /\d++6/" Nested quantifiers in regex; marked by <-- HERE in m/\d++ <-- HERE 6/ at -e line 1. % perl -v This is perl, v5.8.3 built for sun4-solaris ... However, now Perl has changed: >perl -le "print 'no' if '123456' !~ /\d++6/" no >perl -v This is perl, v5.10.0 built for MSWin32-x86-multi-thread ... Could be a limitation of CL-PPCRE or could be that the Regex Coach only needs updated, I'm not sure on this. Regards Ben Golding From edi at agharta.de Mon Feb 16 18:32:52 2009 From: edi at agharta.de (Edi Weitz) Date: Mon, 16 Feb 2009 19:32:52 +0100 Subject: [regex-coach] Feature req: possessive quantifier support (revisited) In-Reply-To: <1234801980.1846.1300669625@webmail.messagingengine.com> References: <1234801980.1846.1300669625@webmail.messagingengine.com> Message-ID: On Mon, Feb 16, 2009 at 5:33 PM, Ben Golding wrote: > I already checked the archives for this issue and it seems I am not the > first to ask: > http://common-lisp.net/pipermail/regex-coach/2005-April/000282.html > > The response from Edi at that time: > "Standalone" regular expressions ("atomic grouping") as in (?>x+) > are > supported, possesive quantifiers as in x++ aren't because they > aren't > in Perl and CL-PPCRE tries to be compatible with Perl. > > That was in 2005. Indeed, using an older Perl: > % perl -e "print 'no' if '123456' !~ /\d++6/" > Nested quantifiers in regex; marked by <-- HERE in m/\d++ <-- HERE > 6/ at -e line 1. > % perl -v > This is perl, v5.8.3 built for sun4-solaris > ... > > However, now Perl has changed: > >perl -le "print 'no' if '123456' !~ /\d++6/" > no > >perl -v > This is perl, v5.10.0 built for MSWin32-x86-multi-thread > ... > > Could be a limitation of CL-PPCRE or could be that the Regex Coach only > needs updated, I'm not sure on this. There's currently no support for this in CL-PPCRE and I have no immediate plans to follow Perl's lead closely unless someone funds the work. Sorry, Edi.