[pcre-dev] [Bug 617] Several questions

Αρχική Σελίδα
Delete this message
Συντάκτης: Felipe Pena
Ημερομηνία:  
Προς: pcre-dev
Αντικείμενο: [pcre-dev] [Bug 617] Several questions
------- You are receiving this mail because: -------
You are on the CC list for the bug.

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




--- Comment #2 from Felipe Pena <felipensp@???> 2007-10-17 13:44:47 ---
Ok, thanks.

felipe@felipe:~$ gdb -q pcretest
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) r re-evil.txt
Starting program: /usr/local/bin/pcretest re-evil.txt
PCRE version 7.4 2007-09-21

/(?(DEFINE)(?<a>(?&b))(?<b>(?&a)))(?&a)/
abcdefghijklmnopqrstuvxz

Program received signal SIGSEGV, Segmentation fault.
0xb7ed6d29 in match () from /usr/local/lib/libpcre.so.0


This problem with recursion is expected, right? It's complicated to build a
prevention, i think. There various way for occur it...

--------------------------------------------

re> /(?+-a)/

Failed: (?R or (?[+-]digits must be followed by ) at offset 3
re> /(?-+a)/

Failed: unrecognized character after (? at offset 3

Shoudn't show the same message?

--------------------------------------------

re> /(?Ca)/

Failed: closing ) for (?C expected at offset 3

Wrong message?

--------------------------------------------

re> /(?(-1))/

Failed: reference to non-existent subpattern at offset 6

But accept:

re> /(?(+10))/


--------------------------------------------


re> /(?<>\d+)/

Failed: unrecognized character after (?< at offset 3

re> /\k''/

Failed: reference to non-existent subpattern at offset 3

Shouldn't the second show message "Failed: syntax error in subpattern name
(missing terminator)"? This occur with \k'`', for example.

--------------------------------------------

re> /(?(DEFINE)(?<b>a+b))(?<a>(a+(*THEN)b|(?&b)))/
data> aaab

0: aaab
1: <unset>
2: aaab
3: aaab

re> /(?<a>(a+(*THEN)b|(?&b)))(?(DEFINE)(?<b>a+b))/
data> aaab

0: aaab
1: aaab
2: aaab

In the last only 2 groups? It's correct?

Regards,
Felipe.


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