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)
160#if QT_CORE_REMOVED_SINCE(6, 8)
184#ifndef QT_NO_DATASTREAM
189#ifndef QT_NO_DEBUG_STREAM
218 int lastCapturedIndex()
const;
220#if QT_CORE_REMOVED_SINCE(6, 8)
226 bool hasCaptured(
int nth)
const;
228 QString captured(
int nth = 0)
const;
231#if QT_CORE_REMOVED_SINCE(6, 8)
243 qsizetype capturedStart(
int nth = 0)
const;
244 qsizetype capturedLength(
int nth = 0)
const;
245 qsizetype capturedEnd(
int nth = 0)
const;
247#if QT_CORE_REMOVED_SINCE(6, 8)
269 QExplicitlySharedDataPointer<QRegularExpressionMatchPrivate>
d;
274#ifndef QT_NO_DEBUG_STREAM
279class QRegularExpressionMatchIteratorRangeBasedForIterator;
295 {
d.
swap(iterator.d);
return *
this; }
298 bool isValid()
const;
314 QExplicitlySharedDataPointer<QRegularExpressionMatchIteratorPrivate>
d;
335 : m_matchIterator(iterator),
345 return m_currentMatch;
351 if (m_matchIterator.hasNext()) {
352 m_currentMatch = m_matchIterator.next();
376 return (&lhs == &rhs);
\inmodule QtCore\reentrant
\inmodule QtCore \reentrant
QRegularExpressionMatchIterator(QRegularExpressionMatchIterator &&iterator)=default
void swap(QRegularExpressionMatchIterator &other) noexcept
Swaps the iterator other with this iterator object.
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
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.
QRegularExpressionMatch(QRegularExpressionMatch &&match)=default
\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.
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
friend bool comparesEqual(const QRegularExpressionMatchIteratorRangeBasedForIterator &lhs, const QRegularExpressionMatchIteratorRangeBasedForIterator &rhs) noexcept
const QRegularExpressionMatch & operator*() const
QRegularExpressionMatchIteratorRangeBasedForIterator operator++(int)
QRegularExpressionMatchIteratorRangeBasedForIterator(const QRegularExpressionMatchIterator &iterator)
std::forward_iterator_tag iterator_category
QRegularExpressionMatchIteratorRangeBasedForIterator & operator++()
QRegularExpressionMatchIteratorRangeBasedForIterator()
Combined button and popup list for selecting options.
QAnyStringView qToAnyStringViewIgnoringNull(const QStringLike &s) noexcept
#define Q_DECLARE_EQUALITY_COMPARABLE(...)
#define Q_DECL_ENUMERATOR_DEPRECATED_X(x)
constexpr bool operator!=(const timespec &t1, const timespec &t2)
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
bool comparesEqual(const QDir &lhs, const QDir &rhs)
#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