[pcre-dev] [Bug 1009] New: "\s" at the end of a character cl…

Góra strony
Delete this message
Autor: Justin Viiret
Data:  
Dla: pcre-dev
Nowe tematy: [pcre-dev] [Bug 1009] "\s" at the end of a character class removes vertical-tab
Temat: [pcre-dev] [Bug 1009] New: "\s" at the end of a character class removes vertical-tab
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1009
           Summary: "\s" at the end of a character class removes vertical-
                    tab
           Product: PCRE
           Version: 7.8
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: justin.viiret@???
                CC: pcre-dev@???



If you create a character class that matches anything (e.g. [\x00-\xff]) and
append \s to it (yielding [\x00-\xff\s], the code to handle \s in
pcre_compile.c removes the vertical-tab character from the class. Prepending \s
to the class does not change the class at all.

I originally noticed this with PCRE 7.8, but PCRE 8.10 behaves the same way.

Some pcretest output showing this:

$ ./pcretest -d
PCRE version 8.10 2010-06-25

re> /[\x00-\xff\s]/

------------------------------------------------------------------
  0  36 Bra
  3     [\x00-\x0a\x0c-\xff]
 36  36 Ket
 39     End
------------------------------------------------------------------
Capturing subpattern count = 0
No options
No first char
No need char

data>
re> /[\s\x00-\xff]/

------------------------------------------------------------------
  0  36 Bra
  3     [\x00-\xff]
 36  36 Ket
 39     End
------------------------------------------------------------------
Capturing subpattern count = 0
No options
No first char
No need char



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