From 0e61e6f014f290857d9d6901f48ca73fc0da9ac0 Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Sat, 29 Sep 2018 18:46:21 +0200 Subject: [PATCH] Amend(1) 73188e3. This is slightly better, but still not satisfying. Enable format search Given the latexified string \emph{Fox jUMps} and using emphasized regex '\w*', we find 'Fox'. That is OK. But the next find finds ' ', which is not OK. In contrast, searching with '\w+', we find the correct string 'jUMps'. --- src/lyxfind.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index ffe7df2137..879c801b6c 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -934,10 +934,10 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions const & regex_replace(par_as_string, par_as_string, "(.*)\\\\}$", "$1"); // save '\.' regex_replace(par_as_string, par_as_string, "\\\\\\.", "_xxbdotxx_"); - // handle '.' -> '[^]', replace later as '[^\}]' + // handle '.' -> '[^]', replace later as '[^\}\{\\]' regex_replace(par_as_string, par_as_string, "\\.", "[^]"); - // replace '[^...]' with '[^...\}]' - regex_replace(par_as_string, par_as_string, "\\[\\^([^\\\\\\]]*)\\]", "_xxbrlxx_$1\\}_xxbrrxx_"); + // replace '[^...]' with '[^...\}\{\\]' + regex_replace(par_as_string, par_as_string, "\\[\\^([^\\\\\\]]*)\\]", "_xxbrlxx_$1\\}\\{\\\\_xxbrrxx_"); regex_replace(par_as_string, par_as_string, "_xxbrlxx_", "[^"); regex_replace(par_as_string, par_as_string, "_xxbrrxx_", "]"); // restore '\.' -- 2.39.2