6#ifndef QREGULAREXPRESSION_H
7#define QREGULAREXPRESSION_H
9#include <QtCore/qglobal.h>
10#include <QtCore/qstring.h>
11#include <QtCore/qstringview.h>
12#include <QtCore/qshareddata.h>
13#include <QtCore/qvariant.h>
94#if QT_DEPRECATED_SINCE(6, 8)
115#if QT_DEPRECATED_SINCE(6, 8)
179#ifndef QT_NO_DATASTREAM
184#ifndef QT_NO_DEBUG_STREAM
201 {
d.swap(
match.d);
return *
this; }
213 int lastCapturedIndex()
const;
218 bool hasCaptured(
int nth)
const;
220 QString captured(
int nth = 0)
const;
230 qsizetype capturedStart(
int nth = 0)
const;
231 qsizetype capturedLength(
int nth = 0)
const;
232 qsizetype capturedEnd(
int nth = 0)
const;
256#ifndef QT_NO_DEBUG_STREAM
261class QRegularExpressionMatchIteratorRangeBasedForIterator;
277 {
d.swap(iterator.d);
return *
this; }
280 bool isValid()
const;
317 : m_matchIterator(iterator),
327 return m_currentMatch;
333 if (m_matchIterator.
hasNext()) {
334 m_currentMatch = m_matchIterator.
next();
357 return (&lhs == &rhs);
363 return !(lhs == rhs);
\inmodule QtCore\reentrant
\inmodule QtCore \reentrant
QRegularExpressionMatchIterator(QRegularExpressionMatchIterator &&iterator)=default
QRegularExpressionMatch next()
Returns the next match result and advances the iterator by one position.
void swap(QRegularExpressionMatchIterator &other) noexcept
Swaps the iterator other with this iterator object.
friend class QRegularExpression
bool hasNext() const
Returns true if there is at least one match result ahead of the iterator; otherwise it returns false.
friend QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIteratorSentinel end(const QRegularExpressionMatchIterator &)
QRegularExpressionMatchIterator & operator=(QRegularExpressionMatchIterator &&iterator) noexcept
Move-assigns the iterator to this object, and returns a reference to the result.
\inmodule QtCore \reentrant
qsizetype capturedEnd(const QString &name) const
Returns the offset inside the subject string immediately after the ending position of the substring c...
void swap(QRegularExpressionMatch &other) noexcept
Swaps the match result other with this match result.
QRegularExpressionMatch & operator=(QRegularExpressionMatch &&match) noexcept
Move-assigns the match result match to this object, and returns a reference to the result.
bool hasCaptured(const QString &name) const
QRegularExpressionMatch(QRegularExpressionMatch &&match)=default
qsizetype capturedStart(const QString &name) const
Returns the offset inside the subject string corresponding to the starting position of the substring ...
qsizetype capturedLength(const QString &name) const
Returns the length of the substring captured by the capturing group named name.
QString captured(const QString &name) const
Returns the substring captured by the capturing group named name.
\inmodule QtCore \reentrant
QRegularExpression(const QRegularExpression &re) noexcept
Constructs a QRegularExpression object as a copy of re.
~QRegularExpression()
Destroys the QRegularExpression object.
bool isValid() const
Returns true if the regular expression is a valid regular expression (that is, it contains no syntax ...
MatchOption
\value NoMatchOption No match options are set.
@ AnchorAtOffsetMatchOption
@ DontCheckSubjectStringMatchOption
PatternOptions patternOptions() const
Returns the pattern options for the regular expression.
bool operator!=(const QRegularExpression &re) const
Returns true if the regular expression is different from re, or false otherwise.
void setPatternOptions(PatternOptions options)
Sets the given options as the pattern options of the regular expression.
int captureCount() const
Returns the number of capturing groups inside the pattern string, or -1 if the regular expression is ...
QRegularExpression & operator=(const QRegularExpression &re) noexcept
Assigns the regular expression re to this object, and returns a reference to the copy.
qsizetype patternErrorOffset() const
Returns the offset, inside the pattern string, at which an error was found when checking the validity...
static QRegularExpression fromWildcard(QStringView pattern, Qt::CaseSensitivity cs=Qt::CaseInsensitive, WildcardConversionOptions options=DefaultWildcardConversion)
void setPattern(const QString &pattern)
Sets the pattern string of the regular expression to pattern.
QStringList namedCaptureGroups() const
PatternOption
The PatternOption enum defines modifiers to the way the pattern string should be interpreted,...
@ ExtendedPatternSyntaxOption
@ InvertedGreedinessOption
@ UseUnicodePropertiesOption
@ DotMatchesEverythingOption
MatchType
The MatchType enum defines the type of the match that should be attempted against the subject string.
@ PartialPreferCompleteMatch
@ PartialPreferFirstMatch
friend class QRegularExpressionMatchIterator
QRegularExpression(QRegularExpression &&re)=default
QRegularExpressionMatch matchView(QStringView subjectView, qsizetype offset=0, MatchType matchType=NormalMatch, MatchOptions matchOptions=NoMatchOption) const
QRegularExpressionMatchIterator globalMatchView(QStringView subjectView, qsizetype offset=0, MatchType matchType=NormalMatch, MatchOptions matchOptions=NoMatchOption) const
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 anchoredPattern(const QString &expression)
static QString wildcardToRegularExpression(const QString &str, WildcardConversionOptions options=DefaultWildcardConversion)
@ NonPathWildcardConversion
@ DefaultWildcardConversion
@ UnanchoredWildcardConversion
QRegularExpression()
Constructs a QRegularExpression object with an empty pattern and no pattern options.
QSharedData & operator=(const QSharedData &)=delete
\macro QT_RESTRICTED_CAST_FROM_ASCII
const QRegularExpressionMatch & operator*() const
QRegularExpressionMatchIteratorRangeBasedForIterator operator++(int)
QRegularExpressionMatchIteratorRangeBasedForIterator(const QRegularExpressionMatchIterator &iterator)
friend bool operator!=(const QRegularExpressionMatchIteratorRangeBasedForIterator &lhs, QRegularExpressionMatchIteratorRangeBasedForIteratorSentinel) noexcept
friend bool operator==(const QRegularExpressionMatchIteratorRangeBasedForIterator &lhs, QRegularExpressionMatchIteratorRangeBasedForIteratorSentinel) noexcept
std::forward_iterator_tag iterator_category
QRegularExpressionMatchIteratorRangeBasedForIterator & operator++()
friend bool operator==(const QRegularExpressionMatchIteratorRangeBasedForIterator &lhs, const QRegularExpressionMatchIteratorRangeBasedForIterator &rhs) noexcept
friend bool operator!=(const QRegularExpressionMatchIteratorRangeBasedForIterator &lhs, const QRegularExpressionMatchIteratorRangeBasedForIterator &rhs) noexcept
QRegularExpressionMatchIteratorRangeBasedForIterator()
Combined button and popup list for selecting options.
#define Q_DECL_ENUMERATOR_DEPRECATED_X(x)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
GLenum GLuint GLintptr offset
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
#define Q_ASSERT_X(cond, x, msg)
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
Q_CORE_EXPORT size_t qHash(const QRegularExpression &key, size_t seed=0) noexcept
Q_CORE_EXPORT QDataStream & operator<<(QDataStream &out, const QRegularExpression &re)
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &in, QRegularExpression &re)
#define QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(Class, ExportMacro)
QStringView qToStringViewIgnoringNull(const QStringLike &s) noexcept
static bool hasNext(const Symbols &symbols, int i)
#define QT_REQUIRE_CONFIG(feature)
#define QT_DEPRECATED_VERSION_X_6_8(text)
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)
static QString escape(const QString &input)
QTextStream out(stdout)
[7]
const QRegularExpression regularExpression
const QRegularExpression::MatchOptions matchOptions
const QRegularExpression::MatchType matchType
const QRegularExpression::MatchType matchType
const QRegularExpression::MatchOptions matchOptions
const QRegularExpression regularExpression