| 2295 |
A user pointed out that PCRE was rejecting [:a[:digit:]] whereas Perl was not. |
A user pointed out that PCRE was rejecting [:a[:digit:]] whereas Perl was not. |
| 2296 |
It seems that the appearance of a nested POSIX class supersedes an apparent |
It seems that the appearance of a nested POSIX class supersedes an apparent |
| 2297 |
external class. For example, [:a[:digit:]b:] matches "a", "b", ":", or |
external class. For example, [:a[:digit:]b:] matches "a", "b", ":", or |
| 2298 |
a digit. |
a digit. |
| 2299 |
|
|
| 2300 |
In Perl, unescaped square brackets may also appear as part of class names. For |
In Perl, unescaped square brackets may also appear as part of class names. For |
| 2301 |
example, [:a[:abc]b:] gives unknown POSIX class "[:abc]b:]". However, for |
example, [:a[:abc]b:] gives unknown POSIX class "[:abc]b:]". However, for |
| 2302 |
[:a[:abc]b][b:] it gives unknown POSIX class "[:abc]b][b:]", which does not |
[:a[:abc]b][b:] it gives unknown POSIX class "[:abc]b][b:]", which does not |
| 2303 |
seem right at all. PCRE does not allow closing square brackets in POSIX class |
seem right at all. PCRE does not allow closing square brackets in POSIX class |
| 2304 |
names. |
names. |
| 2305 |
|
|
| 2306 |
Arguments: |
Arguments: |
| 2319 |
{ |
{ |
| 2320 |
if (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET) |
if (*ptr == CHAR_BACKSLASH && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET) |
| 2321 |
ptr++; |
ptr++; |
| 2322 |
else if (*ptr == CHAR_RIGHT_SQUARE_BRACKET) return FALSE; |
else if (*ptr == CHAR_RIGHT_SQUARE_BRACKET) return FALSE; |
| 2323 |
else |
else |
| 2324 |
{ |
{ |
| 2325 |
if (*ptr == terminator && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET) |
if (*ptr == terminator && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET) |