mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
Replace QRegExp with QRegularExpression
Reviewers: kbasan, msutcliffe Reviewed By: kbasan, msutcliffe Subscribers: jenkins Differential Revision: https://dev.swift-project.org/D11
This commit is contained in:
@@ -346,7 +346,7 @@ namespace BlackMisc
|
||||
{
|
||||
if (errorMessage.isEmpty()) { return errorMessage; }
|
||||
QString phpError(errorMessage);
|
||||
static const QRegularExpression regEx("<[^>]*>");
|
||||
thread_local const QRegularExpression regEx("<[^>]*>");
|
||||
return phpError.remove(regEx);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "blackmisc/pq/constants.h"
|
||||
#include "blackmisc/pq/physicalquantity.h"
|
||||
|
||||
#include <QRegExp>
|
||||
#include <QRegularExpression>
|
||||
#include <Qt>
|
||||
#include <QtGlobal>
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace BlackMisc
|
||||
if (this->isEmpty()) return invalid;
|
||||
if (this->isPrivateMessage()) return invalid;
|
||||
if (this->m_message.length() > 15 || this->m_message.length() < 10) return invalid; // SELCAL AB-CD -> 12, I allow some more characters as I do not know wheter in real life it exactly matches
|
||||
QString candidate = this->m_message.toUpper().remove(QRegExp("[^A-Z]")); // SELCALABCD
|
||||
QString candidate = this->m_message.toUpper().remove(QRegularExpression("[^A-Z]")); // SELCALABCD
|
||||
if (candidate.length() != 10) return invalid;
|
||||
if (!candidate.startsWith("SELCAL")) return invalid;
|
||||
return candidate.right(4).toUpper();
|
||||
|
||||
Reference in New Issue
Block a user