| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RegEx.h
Go to the documentation of this file.
1 #ifndef GAUDIUTILS_REGEX_H
2 #define GAUDIUTILS_REGEX_H
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 #include <string>
7 #include <boost/regex.hpp>
8
9 /*
10 * Gaudi namespace declaration
11 */
12 namespace Gaudi
13 {
14 namespace Utils
15 {
16 // ========================================================================
25 namespace RegEx
26 {
32 template <typename T> bool matchOr(const std::string & test, const T & regexps)
33 {
34 //compares the string in test, to the regexps in a container
35 for (typename T::const_iterator i = regexps.begin();
36 i != regexps.end(); ++i)
37 {
38 const boost::regex pattern(*i);
39 if (boost::regex_match(test, pattern)) return true;
40 }
41 return false;
42 }
43
49 template <typename T> bool matchAnd(const std::string & test, const T & regexps)
50 {
51 //compares the string in test, to the regexps in a container
52 for (typename T::const_iterator i = regexps.begin();
53 i != regexps.end(); ++i)
54 {
55 const boost::regex pattern(*i);
56 if (!boost::regex_match(test, pattern)) return false;
57 }
58 return true;
59 }
60 }
61 }
62 }
63 #endif