11#include <boost/regex.hpp>
30 static constexpr std::size_t
35 return std::numeric_limits< std::size_t >::max();
44 bool is_case_sensative )
46 compiled_regex_t::flag_type regex_flags = boost::regex::ECMAScript;
48 if( !is_case_sensative )
50 regex_flags |= boost::regex::icase;
63 boost::cmatch matches;
67 target_path.data() + target_path.size(),
71 match_results.reserve( matches.size() );
76 std::back_inserter( match_results ),
77 [ begin = target_path.data() ](
const auto & m ){
78 return matched_item_descriptor_t{ m.first - begin, m.second - begin };
nonstd::string_view string_view_t
Regex engine implementation for using with standard regex implementation.
match_results_t::value_type matched_item_descriptor_t
std::vector< std::pair< std::size_t, size_t > > match_results_t
static auto compile_regex(string_view_t r, bool is_case_sensative)
Create compiled regex object for a given route.
boost::regex compiled_regex_t
static auto submatch_begin_pos(const matched_item_descriptor_t &m)
Get the beginning of a submatch.
static constexpr std::size_t max_capture_groups()
static auto submatch_end_pos(const matched_item_descriptor_t &m)
Get the end of a submatch.
static auto try_match(string_view_t target_path, const compiled_regex_t &r, match_results_t &match_results)
Wrapper function for matching logic invokation.