diff --git a/src/ExportManager.cpp b/src/ExportManager.cpp --- a/src/ExportManager.cpp +++ b/src/ExportManager.cpp @@ -179,7 +179,9 @@ title = mWindowTitle.replace(QLatin1Char('/'), QLatin1String("_")); // POSIX doesn't allow "/" in filenames } else { // Remove '%T' with separators around it - const auto wordSymbol = QStringLiteral(R"(\p{L}\p{M}\p{N})"); + // Separators are anything that isn't a unicode letter \p{L}, mark \p{M}, number \p{N} + // or the % character to avoid eating into a nearby pattern. + const auto wordSymbol = QStringLiteral(R"(\p{L}\p{M}\p{N}%)"); const auto separator = QStringLiteral("([^%1]+)").arg(wordSymbol); const auto re = QRegularExpression(QStringLiteral("(.*?)(%1%T|%T%1)(.*?)").arg(separator)); baseName.replace(re, QStringLiteral(R"(\1\5)"));