19 #ifndef SBUILD_REGEX_H
20 #define SBUILD_REGEX_H
26 #include <sbuild/config.h>
27 #ifdef HAVE_REGEX_REGEX
29 #elif HAVE_TR1_REGEX_REGEX
32 using std::tr1::regex;
33 using std::tr1::regex_error;
34 using std::tr1::regex_search;
37 # include <boost/regex.hpp>
40 using boost::regex_error;
41 using boost::regex_search;
78 regex (
const std::string& pattern):
118 compare (
const regex& rhs)
const
120 return this->
rstr != rhs.rstr;
124 search (
const std::string& str)
const
126 return std::regex_search(str, this->
comp);
138 template <
class charT,
class traits>
140 std::basic_istream<charT,traits>&
146 if (std::getline(stream, regex))
148 rhs.
comp.assign(regex, std::regex::extended);
162 template <
class charT,
class traits>
164 std::basic_ostream<charT,traits>&
165 operator << (std::basic_ostream<charT,traits>& stream,
168 return stream << rhs.str();
185 return regex.search(str);