Fix regex start desc computation for case insensitive ranges

Fixes #3345
This commit is contained in:
Maxime Coste 2020-02-07 07:37:29 +11:00
parent 8eb84c6f5d
commit e9cf0f23f2

View File

@ -952,7 +952,9 @@ private:
case ParsedRegex::Class:
{
auto& character_class = m_parsed_regex.character_classes[node.value];
if (character_class.ctypes == CharacterType::None and not character_class.negative)
if (character_class.ctypes == CharacterType::None and
not character_class.negative and
not character_class.ignore_case)
{
for (auto& range : character_class.ranges)
{
@ -1440,6 +1442,11 @@ auto test_regex = UnitTest{[]{
kak_assert(vm.exec("FooFOoBb"));
}
{
TestVM<> vm{R"((?i)[a-z]+)"};
kak_assert(vm.exec("ABC"));
}
{
TestVM<> vm{R"([^\]]+)"};
kak_assert(not vm.exec("a]c"));