| The Gaudi Framework v32r1 (f65d50dc)

Classes | Functions
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

  matchOr | return true if test is in any of the regexps
  matchAnd | return 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

## ◆ matchAnd()

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::string | test [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 71 of file RegEx.h.

71 {
72 // compares the string in test, to the regexps in a container
73 //
74 return std::all_of( std::begin( regexps ), std::end( regexps ), [&]( typename T::const_reference i ) {
75 return boost::regex_match( test, boost::regex{i} );
76 } );
77 }
GaudiTesting.BaseTest.regexps
regexps
Definition: BaseTest.py:1016
std::end
T end(T... args)
compareRootHistos.test
string test
Definition: compareRootHistos.py:15
std::begin
T begin(T... args)
std::all_of
T all_of(T... args)

## ◆ matchOr()

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::string | test [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 54 of file RegEx.h.

54 {
55 // compares the string in test, to the regexps in a container
56 //
57 return std::any_of( std::begin( regexps ), std::end( regexps ), [&]( typename T::const_reference i ) {
58 return boost::regex_match( test, boost::regex{i} );
59 } );
60 }
GaudiTesting.BaseTest.regexps
regexps
Definition: BaseTest.py:1016
std::end
T end(T... args)
compareRootHistos.test
string test
Definition: compareRootHistos.py:15
std::begin
T begin(T... args)
std::any_of
T any_of(T... args)