[pcre-dev] [Bug 1616] Line begin anchor fits not at end of t…

Top Page
Delete this message
Author: David Gausmann
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 1616] Line begin anchor fits not at end of text, if the last character is a new line character
------- You are receiving this mail because: -------
You are on the CC list for the bug.

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




--- Comment #2 from David Gausmann <david.gausmann@???> 2015-04-17 08:54:05 ---
Hello Philip,

you're right, it's documented.
But it is hard to find and the behaviour is not intuitive, but if this is the
behaviour of PERL then PCRE should behave like that.

I've tested this behaviour on different RegEx engines:
- PERL returns three results (as you already mentioned)
- RegEx buddy returns four results (regardless of the selected flavor)
- JavaScript returns four results (on all major browsers)
- VBScript returns four results
- .NET returns four results

In my company I use PCRE as replacement for the VBScript regular expressions.
I've wrote a COM compatible wrapper for that, but until yet everything was
fully compatible. With this behaviour there is an (small) incompatibility.

As you can simply imagine this behaviour is only in very rare cases a problem,
but the problem has occurred in one case (otherwise I wouldn't have created
that ticket).

Could you maybe implement an option flag, which allows to use the non-PERL
behaviour for the line begin anchor?
Then PCRE could be used as compatible replacement for weak flavors like those
from JavaScript/VBScript.


Kind Regards
David Gausmann


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