The Gaudi Framework  v29r0 (ff2e7097)
Gaudi::Utils::RegEx Namespace Reference

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

Classes

class  matchList
 

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

If you need to do this more than once, please first create a matchList object, and then invoke its And method.

Definition at line 79 of file RegEx.h.

80  {
81  // compares the string in test, to the regexps in a container
82  //
83  return std::all_of( std::begin( regexps ), std::end( regexps ), [&]( typename T::const_reference i ) {
84  return boost::regex_match( test, boost::regex{i} );
85  } );
86  }
T end(T...args)
T begin(T...args)
T all_of(T...args)
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

If you need to do this more than once, please first create a matchList object, and then invoke its Or method.

Definition at line 61 of file RegEx.h.

62  {
63  // compares the string in test, to the regexps in a container
64  //
65  return std::any_of( std::begin( regexps ), std::end( regexps ), [&]( typename T::const_reference i ) {
66  return boost::regex_match( test, boost::regex{i} );
67  } );
68  }
T end(T...args)
T begin(T...args)
T any_of(T...args)