Merge pull request #6369 from magao/issue6367

Use Perl-compatible regexes for RSS rules. Closes #6367.
This commit is contained in:
sledgehammer999 2017-03-08 00:04:17 +02:00
commit aa51907387
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
6 changed files with 112 additions and 42 deletions

View file

@ -35,6 +35,7 @@
#include <QCollator>
#include <QtGlobal>
#include <QLocale>
#include <QRegExp>
#ifdef Q_OS_MAC
#include <QThreadStorage>
#endif
@ -178,3 +179,13 @@ bool Utils::String::slowEquals(const QByteArray &a, const QByteArray &b)
return (diff == 0);
}
// This is marked as internal in QRegExp.cpp, but is exported. The alternative would be to
// copy the code from QRegExp::wc2rx().
QString qt_regexp_toCanonical(const QString &pattern, QRegExp::PatternSyntax patternSyntax);
QString Utils::String::wildcardToRegex(const QString &pattern)
{
return qt_regexp_toCanonical(pattern, QRegExp::Wildcard);
}