[pcre-dev] [Bug 776] New: PCRE_DOLLAR_ENDONLY option has no …

Top Page
Delete this message
Author: Mahendra Ladhe
Date:  
To: pcre-dev
New-Topics: [pcre-dev] [Bug 776] PCRE_DOLLAR_ENDONLY option has no effect on pcre_dfa_exec function.
Subject: [pcre-dev] [Bug 776] New: PCRE_DOLLAR_ENDONLY option has no effect on pcre_dfa_exec function.
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=776
           Summary: PCRE_DOLLAR_ENDONLY option has no effect on
                    pcre_dfa_exec function.
           Product: PCRE
           Version: N/A
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: lml108@???
                CC: pcre-dev@???



PCRE version : 7.8

Unlike pcre_exec function, the pcre_dfa_exec function has no code
for processing PCRE_DOLLAR_ENDONLY option.
So even if the PCRE_DOLLAR_ENDONLY option is used for pattern compilation,
with pcre_dfa_exec, dollar does match immediately before a newline at the end
of string, while in fact, it should not.

Please see the interaction below using the pcretest program.

mladhe@linux45:~] pcretest -dfa
PCRE version 7.8 2008-09-05

re> /a\s*$/E
data> a\x0c\x0c\x0a

0: a\x0c\x0c\x0a
1: a\x0c\x0c
data>

As seen above, dollar matched just before the ending \n(\x0a) in the
string, hence it gave the 2nd match of 3 bytes.

Now using the standard-algorithm(pcre_exec).

mladhe@linux45:~] pcretest
PCRE version 7.8 2008-09-05

re> /a\s*$/E
data> a\x0c\x0c\x0a

0: a\x0c\x0c\x0a
data>

Here it gives only one match as dollar matched at the very end of
the string.


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