OSDN Git Service

fix for FreeBSD 11.1.
[hmh/hhml.git] / lib / util_regex.h
1 #ifndef UTIL_REGEXP_H
2 #define UTIL_REGEXP_H
3
4 #include "ustring.h"
5 #include <boost/regex.hpp>
6
7 typedef boost::match_results<ustring::const_iterator>  umatch;
8 typedef boost::basic_regex<char, boost::regex_traits<char> >  uregex;
9
10 inline bool  usearch (ustring::const_iterator first, ustring::const_iterator last, umatch& m, const uregex& re, boost::match_flag_type flags = boost::regex_constants::match_single_line) {
11     return regex_search (first, last, m, re, flags);
12 }
13 inline bool  usearch (const ustring& s, umatch& m, const uregex& re, boost::match_flag_type flags = boost::regex_constants::match_single_line) {
14     return regex_search (s.begin (), s.end (), m, re, flags);
15 }
16
17
18 #endif /* UTIL_REGEXP_H */