00001 #ifndef __REGEXP_H__
00002 #define __REGEXP_H__
00003
00004
00005 class regexp;
00006
00007 class Regexp
00008 {
00009 public:
00010 enum { NSUBEXP = 10 };
00011
00012 Regexp();
00013 Regexp( LPCTSTR exp, BOOL iCase = 0 );
00014 Regexp( const Regexp &r );
00015 ~Regexp();
00016 const Regexp & operator=( const Regexp & r );
00017
00018 bool Match( const TCHAR * s );
00019 int SubStrings() const;
00020
00021 const CString operator[]( unsigned int i ) const;
00022 int SubStart( unsigned int i ) const;
00023 int SubLength( unsigned int i ) const;
00024
00025 CString GetReplaceString( LPCTSTR source ) const;
00026
00027 CString GetErrorString() const;
00028 bool CompiledOK() const;
00029
00030 #if defined( _RE_DEBUG )
00031 void Dump();
00032 #endif
00033 private:
00034 const TCHAR * string;
00035 mutable CString m_szError;
00036 regexp * rc;
00037
00038 void ClearErrorString() const;
00039 int safeIndex( unsigned int i ) const;
00040
00041 };
00042
00043 #endif
00044