11 #include <boost/regex.hpp> 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;
53 return compiled_regex_t{ r.data(), r.size(), regex_flags };
59 string_view_t target_path,
60 const compiled_regex_t & r,
61 match_results_t & match_results )
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 };
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()
Regex engine implementation for using with standard regex implementation.
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.
static auto compile_regex(string_view_t r, bool is_case_sensative)
Create compiled regex object for a given route.
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, optional_t< Value_Type > >::type opt_value(const Parameter_Container ¶ms, string_view_t key)
Gets the value of a parameter specified by key wrapped in optional_t<Value_Type> if parameter exists ...