commit 28b206665fb7a90d0998f927cec003fcef9c573e
Author: Kornel Benko <[email protected]>
Date:   Sat Apr 16 15:10:33 2022 +0200

    FindAdv: Convert '\%' in a regex to '%'
    
    Regex contents comes from handling hullRegexp, so we
    have to reverse some its handling, among others also for the char '%'
---
 src/lyxfind.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index 015e437..2ea1e88 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -838,7 +838,7 @@ string correctRegex(string t, bool withformat)
         * and \{, \}, \[, \] => {, }, [, ]
         */
        string s("");
-       regex wordre("(\\\\)*(\\\\(([A-Za-z]+|[\\{\\}])( 
|\\{\\})?|[\\[\\]\\{\\}]))");
+       regex wordre("(\\\\)*(\\\\(([A-Za-z]+|[\\{\\}%])( 
|\\{\\})?|[\\[\\]\\{\\}]))");
        size_t lastpos = 0;
        smatch sub;
        bool backslashed = false;
@@ -893,6 +893,8 @@ string correctRegex(string t, bool withformat)
                                replace = "{";
                        else if (sub.str(4) == "}")
                                replace = "}";
+                       else if (sub.str(4) == "%")
+                               replace = "%";
                        else {
                                AccentsIterator it_ac = 
accents.find(sub.str(4));
                                if (it_ac == accents.end()) {
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to