5#ifndef ADA_URL_PATTERN_REGEX_H
6#define ADA_URL_PATTERN_REGEX_H
11#ifdef ADA_USE_UNSAFE_STD_REGEX_PROVIDER
15#if ADA_INCLUDE_URL_PATTERN
16namespace ada::url_pattern_regex {
19concept regex_concept =
requires(T t, std::string_view pattern,
20 bool ignore_case, std::string_view input) {
22 typename T::regex_type;
26 T::create_instance(pattern, ignore_case)
27 } -> std::same_as<std::optional<typename T::regex_type>>;
31 T::regex_search(input, std::declval<typename T::regex_type&>())
32 } -> std::same_as<std::optional<std::vector<std::optional<std::string>>>>;
36 T::regex_match(input, std::declval<typename T::regex_type&>())
37 } -> std::same_as<bool>;
40 { T(std::declval<const T&>()) } -> std::same_as<T>;
43 { T(std::declval<T&&>()) } -> std::same_as<T>;
46#ifdef ADA_USE_UNSAFE_STD_REGEX_PROVIDER
47class std_regex_provider final {
49 std_regex_provider() =
default;
50 using regex_type = std::regex;
51 static std::optional<regex_type> create_instance(std::string_view pattern,
53 static std::optional<std::vector<std::optional<std::string>>> regex_search(
54 std::string_view input,
const regex_type& pattern);
55 static bool regex_match(std::string_view input,
const regex_type& pattern);