mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 02:28:35 +00:00
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 '%'
This commit is contained in:
parent
965b2cdc73
commit
28b206665f
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user