00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef QREGEXP3_H
00039 #define QREGEXP3_H
00040 #ifndef QT_H
00041 #include "qstringlist.h"
00042 #endif // QT_H
00043
00044
00045 #if QT_VERSION >= 0x030000
00046 #include <qregexp.h>
00047 #else
00048 class QRegExpEngine;
00049 struct QRegExpPrivate;
00050
00051 class Q_EXPORT QRegExp3
00052 {
00053 public:
00054 QRegExp3();
00055 QRegExp3( const QString& pattern, bool caseSensitive = TRUE,
00056 bool wildcard = FALSE );
00057 QRegExp3( const QRegExp3& rx );
00058 ~QRegExp3();
00059 QRegExp3& operator=( const QRegExp3& rx );
00060
00061 bool operator==( const QRegExp3& rx ) const;
00062 bool operator!=( const QRegExp3& rx ) const { return !operator==( rx ); }
00063
00064 bool isEmpty() const;
00065 bool isValid() const;
00066 QString pattern() const;
00067 void setPattern( const QString& pattern );
00068 bool caseSensitive() const;
00069 void setCaseSensitive( bool sensitive );
00070 #ifndef QT_NO_REGEXP_WILDCARD
00071 bool wildcard() const;
00072 void setWildcard( bool wildcard );
00073 #endif
00074 bool minimal() const;
00075 void setMinimal( bool minimal );
00076
00077 bool exactMatch( const QString& str );
00078 bool exactMatch( const QString& str ) const;
00079 #ifndef QT_NO_COMPAT
00080 int match( const QString& str, int index, int *len = 0,
00081 bool indexIsStart = TRUE );
00082 #endif
00083 int search( const QString& str, int start = 0 );
00084 int search( const QString& str, int start = 0 ) const;
00085
00086 #ifdef QCHAR_SUPPORT
00087 int search(const QChar *str,int start=0);
00088 int search(const QChar *str,int start=0) const;
00089 int searchRev(const QChar *str,int start=-1);
00090 int searchRev(const QChar *str,int start=-1) const ;
00091 bool exactMatch(const QChar *str);
00092 bool exactMatch(const QChar *str) const;
00093
00094 #endif
00095 int searchRev( const QString& str, int start = -1 );
00096 int searchRev( const QString& str, int start = -1 ) const;
00097 int matchedLength();
00098 #ifndef QT_NO_REGEXP_CAPTURE
00099 QStringList capturedTexts();
00100 QString cap( int nth = 0 );
00101 int pos( int nth = 0 );
00102 #endif
00103
00104 private:
00105 void compile( bool caseSensitive );
00106
00107 QRegExpEngine *eng;
00108 QRegExpPrivate *priv;
00109 };
00110 #endif // QT_VERSION >= 0x030000
00111 #endif // QREGEXP_H