commit 0e61e6f014f290857d9d6901f48ca73fc0da9ac0 Author: Kornel Benko <kor...@lyx.org> Date: Sat Sep 29 18:46:21 2018 +0200
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 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index ffe7df2..879c801 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 '\.'