QtCore/qregexp.h Source File
Go to the documentation of this file.
58 struct QRegExpPrivate;
71 enum CaretMode { CaretAtZero, CaretAtOffset, CaretWontMatch };
75 PatternSyntax syntax = RegExp);
76 QRegExp(
const QRegExp &rx);
78 QRegExp &operator=(
const QRegExp &rx);
79 #ifdef Q_COMPILER_RVALUE_REFS
80 inline QRegExp &operator=(QRegExp &&other)
81 {
qSwap(priv,other.priv);
return *
this; }
83 inline void swap(QRegExp &other) {
qSwap(priv, other.priv); }
91 void setPattern(
const QString &pattern);
95 inline QT3_SUPPORT
bool caseSensitive()
const {
return caseSensitivity() ==
Qt::CaseSensitive; }
96 inline QT3_SUPPORT
void setCaseSensitive(
bool sensitive)
99 PatternSyntax patternSyntax()
const;
100 void setPatternSyntax(PatternSyntax syntax);
102 inline QT3_SUPPORT
bool wildcard()
const {
return patternSyntax() == Wildcard; }
103 inline QT3_SUPPORT
void setWildcard(
bool aWildcard)
104 { setPatternSyntax(aWildcard ? Wildcard : RegExp); }
107 bool isMinimal()
const;
108 void setMinimal(
bool minimal);
110 inline QT3_SUPPORT
bool minimal()
const {
return isMinimal(); }
113 bool exactMatch(
const QString &str)
const;
115 int indexIn(
const QString &str,
int offset = 0, CaretMode caretMode = CaretAtZero)
const;
116 int lastIndexIn(
const QString &str,
int offset = -1, CaretMode caretMode = CaretAtZero)
const;
118 inline QT3_SUPPORT
int search(
const QString &str,
int from = 0,
119 CaretMode caretMode = CaretAtZero)
const
120 {
return indexIn(str, from, caretMode); }
121 inline QT3_SUPPORT
int searchRev(
const QString &str,
int from = -1,
122 CaretMode caretMode = CaretAtZero)
const
123 {
return lastIndexIn(str, from, caretMode); }
125 int matchedLength()
const;
126 #ifndef QT_NO_REGEXP_CAPTURE
128 QT_DEPRECATED
int numCaptures()
const;
130 int captureCount()
const;
131 QStringList capturedTexts()
const;
132 QStringList capturedTexts();
135 int pos(
int nth = 0)
const;
136 int pos(
int nth = 0);
144 inline QT3_SUPPORT_CONSTRUCTOR QRegExp(
const QString &aPattern,
bool cs,
bool aWildcard =
false)
148 aWildcard ? Wildcard : RegExp);
153 QRegExpPrivate *priv;
158 #ifndef QT_NO_DATASTREAM
167 #endif // QT_NO_REGEXP
bool operator!=(const QRegExp &rx) const
void swap(QRegExp &other)
bool operator==(const Attribute &cA, const AttributeInstance< type > &cB)
This operator compares the two attributes and NOT their values.
Q_DECLARE_TYPEINFO(QRegExp, Q_MOVABLE_TYPE)
#define QT_BEGIN_NAMESPACE
Q_INLINE_TEMPLATE void qSwap(QScopedPointer< T, Cleanup > &p1, QScopedPointer< T, Cleanup > &p2)
Q_GUI_EXPORT QString escape(const QString &plain)
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &in, QRegExp ®Exp)
Q_CORE_EXPORT QDataStream & operator<<(QDataStream &out, const QRegExp ®Exp)