some optimizations for character classes in case-insensitive mode