2454 |
} |
} |
2455 |
|
|
2456 |
/* If the first character is '^', set the negation flag and skip it. Also, |
/* If the first character is '^', set the negation flag and skip it. Also, |
2457 |
if the first few characters (either before or after ^) are \Q\E or \E we |
if the first few characters (either before or after ^) are \Q\E or \E we |
2458 |
skip them too. This makes for compatibility with Perl. */ |
skip them too. This makes for compatibility with Perl. */ |
2459 |
|
|
2460 |
negate_class = FALSE; |
negate_class = FALSE; |
2461 |
for (;;) |
for (;;) |
2462 |
{ |
{ |
2463 |
c = *(++ptr); |
c = *(++ptr); |
2464 |
if (c == '\\') |
if (c == '\\') |
2465 |
{ |
{ |
2466 |
if (ptr[1] == 'E') ptr++; |
if (ptr[1] == 'E') ptr++; |
2467 |
else if (strncmp((const char *)ptr+1, "Q\\E", 3) == 0) ptr += 3; |
else if (strncmp((const char *)ptr+1, "Q\\E", 3) == 0) ptr += 3; |
2468 |
else break; |
else break; |
2469 |
} |
} |
2470 |
else if (!negate_class && c == '^') |
else if (!negate_class && c == '^') |
2471 |
negate_class = TRUE; |
negate_class = TRUE; |
2472 |
else break; |
else break; |
2473 |
} |
} |
2474 |
|
|
2475 |
/* Keep a count of chars with values < 256 so that we can optimize the case |
/* Keep a count of chars with values < 256 so that we can optimize the case |
2476 |
of just a single character (as long as it's < 256). However, For higher |
of just a single character (as long as it's < 256). However, For higher |
3075 |
*errorcodeptr = ERR6; |
*errorcodeptr = ERR6; |
3076 |
goto FAILED; |
goto FAILED; |
3077 |
} |
} |
3078 |
|
|
3079 |
/* If class_charcount is 1, we saw precisely one character whose value is |
/* If class_charcount is 1, we saw precisely one character whose value is |
3080 |
less than 256. In non-UTF-8 mode we can always optimize. In UTF-8 mode, we |
less than 256. In non-UTF-8 mode we can always optimize. In UTF-8 mode, we |
3081 |
can optimize the negative case only if there were no characters >= 128 |
can optimize the negative case only if there were no characters >= 128 |