[pcre-dev] [Bug 2761] New: DFA partial matching does not yie…

Góra strony
Delete this message
Autor: admin
Data:  
Dla: pcre-dev
Temat: [pcre-dev] [Bug 2761] New: DFA partial matching does not yield same results as non-partial
https://bugs.exim.org/show_bug.cgi?id=2761

            Bug ID: 2761
           Summary: DFA partial matching does not yield same results as
                    non-partial
           Product: PCRE
           Version: 10.36 (PCRE2)
          Hardware: x86-64
                OS: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
          Assignee: Philip.Hazel@???
          Reporter: stevenjshuck@???
                CC: pcre-dev@???


Created attachment 1390
--> https://bugs.exim.org/attachment.cgi?id=1390&action=edit
dfa.c

I am attempting to match the pattern
    <[^<]*>
to the subject
    < foo < bar >
in two different ways:
1.  a single contiguous subject "< foo < bar >"
2.  the subject chunked into two strings, "< foo " and "< bar >", detecting
partial match and restarting per the docs.


Please find attached my test case. I compiled and ran it these ways:
$ gcc -DPARTIAL=PCRE2_PARTIAL_HARD dfa.c -o dfa -lpcre2-8 && ./dfa
$ gcc -DPARTIAL=PCRE2_PARTIAL_SOFT dfa.c -o dfa -lpcre2-8 && ./dfa

This was the output either way:

Pattern: "<[^<]*>"

Subject: "< foo < bar >"
Result: 1
First two ovector values: 6, 13

Subject: "< foo "
Result: -2
First two ovector values: 0, 6

Restarting...
Subject: "< bar >"
Result: -1
First two ovector values: 0, 6


For the purposes of this ticket, I don't care so much what the results are,
just that they be consistent between the chunked and non-chunked subjects.

--
You are receiving this mail because:
You are on the CC list for the bug.