From c7bc46d707b3c790be50f55353a4bd929789fe62 Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Sun, 27 Dec 2020 12:16:37 +0100 Subject: [PATCH] Amend 3736bee4: Forgot to set the cassensitivity flag in regex statement --- src/lyxfind.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index a9988f978e..e7f345b6e3 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -2884,10 +2884,15 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions const & regexp2_str = "(" + lead_as_regexp + ").*?" + par_as_string; } LYXERR(Debug::FIND, "Setting regexp to : '" << regexp_str << "'"); - regexp = regex(regexp_str); - LYXERR(Debug::FIND, "Setting regexp2 to: '" << regexp2_str << "'"); - regexp2 = regex(regexp2_str); + if (! opt.casesensitive) { + regexp = regex(regexp_str, std::regex_constants::icase); + regexp2 = regex(regexp2_str, std::regex_constants::icase); + } + else { + regexp = regex(regexp_str); + regexp2 = regex(regexp2_str); + } } }