| # Gaudi Framework, version v23r1 |

Home |  | Generated: Wed Feb 29 2012

Functions

# 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
template<typename T >
bool | matchAnd (const std::string &test, const T &regexps)
| return true if the string is in all of the regex's

## 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.Lambert@cern.ch

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::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

Definition at line 49 of file RegEx.h.

          {
            //compares the string in test, to the regexps in a container
            for (typename T::const_iterator i = regexps.begin();
                 i != regexps.end(); ++i)
            {
              const boost::regex pattern(*i);
              if (!boost::regex_match(test, pattern)) return false;
            }
            return true;
          }

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

Definition at line 32 of file RegEx.h.

          {
            //compares the string in test, to the regexps in a container
            for (typename T::const_iterator i = regexps.begin();
                 i != regexps.end(); ++i)
            {
              const boost::regex pattern(*i);
              if (boost::regex_match(test, pattern)) return true;
            }
            return false;
          }

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines