Enable multiline regex pattern matching

This commit is contained in:
WarmUpTill
2022-09-10 22:17:40 +02:00
committed by WarmUpTill
parent a93305e16e
commit d99618d2f6

View File

@@ -51,12 +51,12 @@ bool MacroConditionFile::matchFileContent(QString &filedata)
}
if (_useRegex) {
try {
std::regex expr(_text);
return std::regex_match(filedata.toStdString(), expr);
} catch (const std::regex_error &) {
QRegularExpression expr(QString::fromStdString(_text));
if (!expr.isValid()) {
return false;
}
auto match = expr.match(filedata);
return match.hasMatch();
}
QString text = QString::fromStdString(_text);