5 #ifndef BALL_DATATYPE_REGULAREXPRESSION_H
6 #define BALL_DATATYPE_REGULAREXPRESSION_H
12 #ifdef BALL_HAS_BOOST_REGEX
13 # include <boost/regex.h>
16 #if !defined(__GNUC__) && !defined(__KAI__) && defined(IRIX)
17 # pragma set woff 1174
20 #ifdef BALL_HAS_SYS_TYPES_H
21 # include <sys/types.h>
24 #ifdef BALL_HAS_REGEX_H
27 # ifdef BALL_COMPILER_MSVC
32 # ifdef BALL_COMPILER_MSVC
39 #if !defined(__GNUC__) && !defined(__KAI__) && defined(IRIX)
40 # pragma reset woff 1174
43 #ifndef BALL_DATATYPE_STRING_H
47 #define BALL_REGULAR_EXPRESSION_DEFAULT_PATTERN ""
86 static const
String HEXADECIMAL_INTEGER;
98 static const
String NON_ALPHANUMERIC;
134 virtual
void clear();
145 RegularExpression& operator = (const RegularExpression& expression);
148 void set(const RegularExpression& regular_expression);
151 void set(const
String& pattern,
bool wildcard_pattern = false);
154 void get(RegularExpression& regular_expression) const;
162 const
String& getPattern() const;
165 Size countSubexpressions() const;
174 static
bool match(const
char* text, const
char* pattern,
175 int compile_flags = 0 | REG_EXTENDED | REG_NOSUB,
int execute_flags = 0);
184 bool match(const
String& text,
Index from = 0,
int execute_flags = 0) const;
194 bool match(const
Substring& text,
Index from = 0,
int execute_flags = 0) const;
201 bool match(const
char* text,
int execute_flags = 0) const;
211 Index from = 0,
int execute_flags = 0) const;
222 Index from = 0,
int execute_flags = 0) const;
231 bool isEmpty() const;
235 bool operator == (const RegularExpression& regular_expression) const;
239 bool operator != (const RegularExpression& regular_expression) const;
243 bool operator < (const RegularExpression& regular_expression) const;
247 bool operator <= (const RegularExpression& regular_expression) const;
251 bool operator >= (const RegularExpression& regular_expression) const;
255 bool operator > (const RegularExpression& regular_expression) const;
264 virtual
bool isValid() const;
271 virtual
void dump(std::ostream& s = std::cout,
Size depth = 0) const;
281 friend std::ostream& operator << (std::ostream& s, const RegularExpression& regular_expression);
286 friend std::istream& operator >> (std::istream& s, RegularExpression& regular_expression);
292 void compilePattern_();
294 void toExtendedRegularExpression_();
302 # ifndef BALL_NO_INLINE_FUNCTIONS
303 # include <BALL/DATATYPE/regularExpression.iC>
307 #endif // BALL_DATATYPE_REGULAREXPRESSION_H