MCPcopy Create free account
hub / github.com/ada-url/ada / create_instance

Method create_instance

src/url_pattern_regex.cpp:8–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7#ifdef ADA_USE_UNSAFE_STD_REGEX_PROVIDER
8std::optional<std::regex> std_regex_provider::create_instance(
9 std::string_view pattern, bool ignore_case) {
10 // Let flags be an empty string.
11 // If options's ignore case is true then set flags to "vi".
12 // Otherwise set flags to "v"
13 auto flags = ignore_case
14 ? std::regex::icase | std::regex_constants::ECMAScript
15 : std::regex_constants::ECMAScript;
16 try {
17 return std::regex(pattern.data(), pattern.size(), flags);
18 } catch (const std::regex_error& e) {
19 (void)e;
20 ada_log("std_regex_provider::create_instance failed:", e.what());
21 return std::nullopt;
22 }
23}
24
25std::optional<std::vector<std::optional<std::string>>>
26std_regex_provider::regex_search(std::string_view input,

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.80
whatMethod · 0.80

Tested by

no test coverage detected