6#include <QRegularExpression>
7#include <QRegularExpressionMatch>
8#include <QRegularExpressionMatchIterator>
62QRegularExpression::PatternOptions options = re.patternOptions();
72bool hasMatch =
match.hasMatch();
80if (
match.hasMatch()) {
91if (
match.hasMatch()) {
102if (
match.hasMatch()) {
115if (
match.hasMatch()) {
116 int startOffset =
match.capturedStart(1);
117 int endOffset =
match.capturedEnd(1);
127if (
match.hasMatch()) {
154QString pattern(
"^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d\\d?, \\d\\d\\d\\d$");
159bool hasMatch =
match.hasMatch();
160bool hasPartialMatch =
match.hasPartialMatch();
165QString pattern(
"^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d\\d?, \\d\\d\\d\\d$");
170bool hasMatch =
match.hasMatch();
171bool hasPartialMatch =
match.hasPartialMatch();
179bool hasMatch =
match.hasMatch();
180bool hasPartialMatch =
match.hasPartialMatch();
189bool hasMatch =
match.hasMatch();
190bool hasPartialMatch =
match.hasPartialMatch();
199bool hasMatch =
match.hasMatch();
200bool hasPartialMatch =
match.hasPartialMatch();
208bool hasMatch =
match.hasMatch();
209bool hasPartialMatch =
match.hasPartialMatch();
217bool hasMatch =
match.hasMatch();
218bool hasPartialMatch =
match.hasPartialMatch();
225bool isValid = invalidRe.isValid();
232if (!invalidRe.isValid()) {
233 QString errorString = invalidRe.errorString();
234 int errorOffset = invalidRe.patternErrorOffset();
262for (
int i = 0;
i <=
match.lastCapturedIndex(); ++
i) {
273if (
match.hasMatch()) {
284QString subject(
"the quick fox");
304 (?<day>\d\d)-(?<month>\
d\
d)-(?<year>\d\d\d\d) (\
w+) (?<
name>\
w+)
308 (
"",
"day",
"month",
"year",
"",
"name")
316QString subject("the quick fox");
\inmodule QtCore \reentrant
\inmodule QtCore \reentrant
\inmodule QtCore \reentrant
static QString escape(const QString &str)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setPattern(const QString &pattern)
Sets the pattern string of the regular expression to pattern.
@ DotMatchesEverythingOption
@ PartialPreferCompleteMatch
@ PartialPreferFirstMatch
static QString wildcardToRegularExpression(const QString &str, WildcardConversionOptions options=DefaultWildcardConversion)
\macro QT_RESTRICTED_CAST_FROM_ASCII
GLfloat GLfloat GLfloat w
[0]
GLenum GLenum GLenum input
GLsizei const GLchar *const * string
[0]
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)