fix: Adjust invalid regex. Escape '-' as that one is not representing a range.

This commit is contained in:
Sirius Bakke 2023-07-22 20:06:16 +02:00
parent 003d5c2ce8
commit a940362776
1 changed files with 2 additions and 2 deletions

View File

@ -171,11 +171,11 @@ void RuleSetDialog::validate(bool *res)
// Do not allow ':' in the rule set names because this character is
// used as a separator in error and warning messages
QString pattern("([a-zA-Z0-9_-+=@%^]+)");
QString pattern("([a-zA-Z0-9_\\-+=@%^]+)");
// branch (anchor) names for PF may end with "/*"
if (platform == "pf")
pattern = "([a-zA-Z0-9_-+=@%^]+)(/\\*)?";
pattern = "([a-zA-Z0-9_\\-+=@%^]+)(/\\*)?";
QRegularExpression rx = QRegularExpression(QRegularExpression::anchoredPattern(pattern));