All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Gaudi::Utils::RegEx Namespace Reference

RegeEx: nemspace to hold gaudi regular expression checking. More...

Functions

template<typename T >
bool matchOr (const std::string &test, const T &regexps)
 return true if the string is in any of the regex's More...
 
template<typename T >
bool matchAnd (const std::string &test, const T &regexps)
 return true if the string is in all of the regex's More...
 

Detailed Description

RegeEx: nemspace to hold gaudi regular expression checking.

Parameters
matchOrreturn true if test is in any of the regexps
matchAndreturn true if test is in all of the regexps
Author
Rob Lambert Rob.L.nosp@m.ambe.nosp@m.rt@ce.nosp@m.rn.c.nosp@m.h
Date
2009-07-29

Function Documentation

template<typename T >
bool Gaudi::Utils::RegEx::matchAnd ( const std::string &  test,
const T &  regexps 
)

return true if the string is in all of the regex's

Parameters
std::stringtest [IN]: string to match
container<std::string>regexps [IN]: container of regex strings can be any container with a const_iterator, begin and end

Definition at line 49 of file RegEx.h.

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  }
list i
Definition: ana.py:128
template<typename T >
bool Gaudi::Utils::RegEx::matchOr ( const std::string &  test,
const T &  regexps 
)

return true if the string is in any of the regex's

Parameters
std::stringtest [IN]: string to match
container<std::string>regexps [IN]: container of regex strings can be any container with a const_iterator, begin and end

Definition at line 32 of file RegEx.h.

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  }
list i
Definition: ana.py:128