Description
There are a couple of problems in interpreting character ranges in "case-insensitive" mode.
When doing range subtraction (or negation), all the case-variants of the subtracted characters need to be considered. For example, "[^Q]" means, in case-insensitive mode, "any character except 'q' or 'Q'" but the regex engine matches both 'q' and 'Q' in this example.
Also, in case-insensitive mode, all character classes must stay the same, so for example "\p
{Lu}" would not match a lowercase letter, but the regex engine matches 'q'.