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

トップ ページ
このメッセージを削除
著者: Philip Hazel
日付:  
To: pcre-dev
題目: [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 #1 from Philip Hazel <ph10@???> 2015-04-16 17:13:45 ---
On Thu, 16 Apr 2015, David Gausmann wrote:

> My regular expression has the following pattern: ^
> The search option is PCRE2_MULTILINE.
> The text, I am search through, has the following content: \n\n\n
> The new line behaviour is PCRE2_NEWLINE_ANYCRLF.
>
> I whould expect, that I get four results:
> - Offset 0
> - Offset 1
> - Offset 2
> - Offset 3
>
> Instead I get only the first three results.


This is in accordance with what both pcre2test and Perl give, when run
in "global" mode. To quote the pcre2pattern page: "The meanings of the
circumflex and dollar characters are changed if the PCRE2_MULTILINE
option is set. When this is the case, a circumflex matches immediately
after internal newlines as well as at the start of the subject string.
It does not match after a newline that ends the string."

So it seems to be behaving as specified.

Philip


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