[pcre-dev] [Bug 1619] zero-width negative lookahead with cap…

Startseite
Nachricht löschen
Autor: Zoltan Herczeg
Datum:  
To: pcre-dev
Betreff: [pcre-dev] [Bug 1619] zero-width negative lookahead with capture not working
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1619




--- Comment #5 from Zoltan Herczeg <hzmester@???> 2015-04-23 20:54:15 ---
> I just tried this in node.js and it does match


But the capturing brackets are different! This is what I explained. You can
make this match with PCRE2_MATCH_UNSET_BACKREF in pcre2test:

re> /(.*?)a(?!(a+)b\2c)\2(.*)/match_unset_backref
data> baaabaac

0: baaabaac
1: ba
2: <unset>
3: abaac

In Perl you get:

0: baaabaac
1: ba
2: a
3: baac

This is what is different, and cannot be mimicked by JS or PCRE.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email