blob: 7714017d7cb6ebee983cc7bb7d0a881a7d4f781f (
plain)
1 ////////////////////////////////////////////////////////////////////////
2 // FILE: regex.h
3 // AUTHOR: Johannes Winkelmann, jw@tks6.net
4 // COPYRIGHT: (c) 2005 by Johannes Winkelmann
5 // ---------------------------------------------------------------------
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 ////////////////////////////////////////////////////////////////////////
11
12
13 #ifndef _PG_REGEX_H_
14 #define _PG_REGEX_H_
15
16 #include <sys/types.h>
17 #include <regex.h>
18 #include <string>
19
20
21 class RegEx
22 {
23 public:
24 RegEx(const std::string& pattern, bool caseSensitive=false);
25 ~RegEx();
26
27 bool match(const std::string& input);
28
29 static bool match(const std::string& pattern,
30 const std::string& input,
31 bool caseSensitive=false);
32
33 private:
34 regex_t m_pattern;
35 bool m_validPattern;
36 };
37
38
39 #endif /* _REGEX_H_ */
|