Utils ip address regexp

This commit is contained in:
pokamest 2021-02-25 18:03:24 +03:00
parent a47ab15aef
commit 7dc1f1e225
3 changed files with 14 additions and 37 deletions

View file

@ -1,6 +1,7 @@
#ifndef UTILS_H
#define UTILS_H
#include <QRegExp>
#include <QString>
class Utils {
@ -19,6 +20,7 @@ public:
static QString getIPAddress(const QString& host);
static QString getStringBetween(const QString& s, const QString& a, const QString& b);
static bool checkIPFormat(const QString& ip);
static QRegExp ipAddressRegExp() { return QRegExp("^((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])(\\.(?!$)|$)){4}$"); }
};
#endif // UTILS_H