19 #ifndef SBUILD_REGEX_H
20 #define SBUILD_REGEX_H
26 #include <sbuild/sbuild-config.h>
27 #ifdef HAVE_REGEX_REGEX
30 # include <boost/regex.hpp>
33 using boost::regex_error;
34 using boost::regex_search;
71 regex (std::string
const& pattern):
111 compare (
regex const& rhs)
const
113 return this->
rstr != rhs.rstr;
117 search (std::string
const& str)
const
119 return std::regex_search(str, this->
comp);
131 template <
class charT,
class traits>
133 std::basic_istream<charT,traits>&
139 if (std::getline(stream, regex))
141 rhs.
comp.assign(regex, std::regex::extended);
155 template <
class charT,
class traits>
157 std::basic_ostream<charT,traits>&
158 operator << (std::basic_ostream<charT,traits>& stream,
161 return stream << rhs.str();
178 return regex.search(str);