I'm replacing a QString
using QRegularExpression
but I have a problem with escaped tokens.
For example: a "{aaa}"
in the string should be replace with a "bbb"
but a "\{aaa}"
should be ignored and a "{aaa}"
will be set (without the "\"
).
eg:
this is a test called {aaa} -> this is a test called bbb
this is a test called \{aaa} -> this is a test called {aaa}
I'm using
QString& replace(const QRegularExpression& re, const QString& after);
but I cannot find a way to skip an escaped match. I guess with a negative look-behind, but how?