Qx v0.7
Qt Extensions Library
Loading...
Searching...
No Matches
qx-regularexpression.h
1#ifndef QX_REGULAREXPRESSION_H
2#define QX_REGULAREXPRESSION_H
3
4// Qt Includes
5#include <QRegularExpression>
6
7using namespace Qt::Literals::StringLiterals;
8
9namespace Qx
10{
11
13{
14//-Class Variables---------------------------------------------------------------------------------------------
15public:
16 static inline const QRegularExpression HEX_ONLY = QRegularExpression(u"^[a-fA-F0-9]+$"_s, QRegularExpression::CaseInsensitiveOption);
17 static inline const QRegularExpression ANY_NON_HEX = QRegularExpression(u"[^a-fA-F0-9 -]"_s, QRegularExpression::CaseInsensitiveOption);
18 static inline const QRegularExpression NUMBERS_ONLY = QRegularExpression(u"^[0-9]*$"_s, QRegularExpression::CaseInsensitiveOption); // a digit (\d)
19 static inline const QRegularExpression ALPHANUMERIC_ONLY = QRegularExpression(u"^[a-zA-Z0-9]*$"_s, QRegularExpression::CaseInsensitiveOption);
20 static inline const QRegularExpression LETTERS_ONLY = QRegularExpression(u"^[a-zA-Z]+$"_s, QRegularExpression::CaseInsensitiveOption);
21 static inline const QRegularExpression SEMANTIC_VERSION = QRegularExpression(
22 u"(?P<major>0|[1-9]\\d*)"_s
23 u"\\."_s
24 u"(?P<minor>0|[1-9]\\d*)"_s
25 u"\\."_s
26 u"(?P<patch>0|[1-9]\\d*)"_s
27 u"(?:-(?P<prerelease>(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?"_s
28 u"(?:\\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?"_s);
29 static inline const QRegularExpression LONG_SEMANTIC_VERSION = QRegularExpression(
30 u"(?P<major>0|[1-9]\\d*)"_s
31 u"\\."_s
32 u"(?P<minor>0|[1-9]\\d*)"_s
33 u"\\."_s
34 u"(?P<patch>0|[1-9]\\d*)"_s
35 u"\\."_s
36 u"(?P<revision>0|[1-9]\\d*)"_s
37 u"(?:-(?P<prerelease>(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?"_s
38 u"(?:\\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?"_s);
39 static inline const QRegularExpression LINE_BREAKS = QRegularExpression(u"[\\r\\n\\v]"_s);
40 static inline const QRegularExpression WHITESPACE = QRegularExpression(u"[\\f\\n\\r\\t\\v\x20\xA0\x00A0\u2028\u2029]"_s);
41};
42
43}
44
45#endif // QX_REGULAREXPRESSION_H
The RegularExpression class is a collection of convenient regular expression statements.
Definition qx-regularexpression.h:13
static const QRegularExpression LINE_BREAKS
Definition qx-regularexpression.h:39
static const QRegularExpression WHITESPACE
Definition qx-regularexpression.h:40
static const QRegularExpression LETTERS_ONLY
Definition qx-regularexpression.h:20
static const QRegularExpression ALPHANUMERIC_ONLY
Definition qx-regularexpression.h:19
static const QRegularExpression HEX_ONLY
Definition qx-regularexpression.h:16
static const QRegularExpression SEMANTIC_VERSION
Definition qx-regularexpression.h:21
static const QRegularExpression ANY_NON_HEX
Definition qx-regularexpression.h:17
static const QRegularExpression LONG_SEMANTIC_VERSION
Definition qx-regularexpression.h:29
static const QRegularExpression NUMBERS_ONLY
Definition qx-regularexpression.h:18
The Qx namespace is the main namespace through which all non-global functionality of the Qx library i...
Definition qx-abstracterror.cpp:13