Use QRegularExpression instead of deprecated QRegExp

Now it follows closely the definition of wildcard for glob patterns.
The backslash (\) character is not an escape char in this context.
In order to match one of the special characters, place it in square
brackets (for example, [?]).
This commit is contained in:
Vladimir Golovnev (Glassez) 2021-03-14 18:11:23 +03:00
parent ea1c4a8fc8
commit 61d2ff359b
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
11 changed files with 53 additions and 32 deletions

View file

@ -719,10 +719,14 @@ void AutomatedRssDownloader::updateMustLineValidity()
{
QStringList tokens;
if (isRegex)
{
tokens << text;
}
else
{
for (const QString &token : asConst(text.split('|')))
tokens << Utils::String::wildcardToRegex(token);
tokens << Utils::String::wildcardToRegexPattern(token);
}
for (const QString &token : asConst(tokens))
{
@ -762,10 +766,14 @@ void AutomatedRssDownloader::updateMustNotLineValidity()
{
QStringList tokens;
if (isRegex)
{
tokens << text;
}
else
{
for (const QString &token : asConst(text.split('|')))
tokens << Utils::String::wildcardToRegex(token);
tokens << Utils::String::wildcardToRegexPattern(token);
}
for (const QString &token : asConst(tokens))
{