6#include <QRegularExpression>
7#include <QRegularExpressionMatch>
8#include <QRegularExpressionMatchIterator>
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();
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
bool isValid() const
Returns true if the regular expression is a valid regular expression (that is, it contains no syntax ...
PatternOptions patternOptions() const
Returns the pattern options for the regular expression.
void setPatternOptions(PatternOptions options)
Sets the given options as the pattern options of the regular expression.
qsizetype patternErrorOffset() const
Returns the offset, inside the pattern string, at which an error was found when checking the validity...
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
QString pattern() const
Returns the pattern string of the regular expression.
QRegularExpressionMatch match(const QString &subject, qsizetype offset=0, MatchType matchType=NormalMatch, MatchOptions matchOptions=NoMatchOption) const
Attempts to match the regular expression against the given subject string, starting at the position o...
QString errorString() const
Returns a textual description of the error found when checking the validity of the regular expression...
QRegularExpressionMatchIterator globalMatch(const QString &subject, qsizetype offset=0, MatchType matchType=NormalMatch, MatchOptions matchOptions=NoMatchOption) const
Attempts to perform a global match of the regular expression against the given subject string,...
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)