1 #ifndef GAUDIUTILS_REGEX_H
2 #define GAUDIUTILS_REGEX_H
7 #include <boost/regex.hpp>
31 m_regs.reserve(c.size());
33 std::back_inserter(m_regs),
34 [](
typename C::const_reference
i) {
return boost::regex{i}; } );
37 bool Or(
const std::string&
test)
const {
39 [&](
const boost::regex& r) {
40 return boost::regex_match(test, r);
45 [&](
const boost::regex& r) {
46 return boost::regex_match(test, r);
60 template <
typename T>
bool matchOr(
const std::string &
test,
const T & regexps)
65 [&](
typename T::const_reference
i) {
66 return boost::regex_match(test, boost::regex{i});
78 template <
typename T>
bool matchAnd(
const std::string &
test,
const T & regexps)
83 [&](
typename T::const_reference
i) {
84 return boost::regex_match(test, boost::regex{i});
auto begin(reverse_wrapper< T > &w)
bool Or(const std::string &test) const
bool matchOr(const std::string &test, const T ®exps)
return true if the string is in any of the regex's
std::vector< boost::regex > m_regs
auto end(reverse_wrapper< T > &w)
bool And(const std::string &test) const
bool matchAnd(const std::string &test, const T ®exps)
return true if the string is in all of the regex's
Helper functions to set/get the application return code.