mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-15 13:53:19 -05:00
Enable multiline regex pattern matching
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user