8#include <userver/utils/fast_pimpl.hpp>
10USERVER_NAMESPACE_BEGIN
22 explicit regex(std::string_view pattern);
27 regex(regex&&)
noexcept;
29 regex& operator=(
const regex&);
30 regex& operator=(regex&&)
noexcept;
32 bool operator==(
const regex&)
const;
34 std::string str()
const;
38 utils::FastPimpl<Impl, 16, 8> impl_;
40 friend class match_results;
41 friend bool regex_match(std::string_view str,
const regex& pattern);
42 friend bool regex_match(std::string_view str, match_results& m,
const regex& pattern);
43 friend bool regex_search(std::string_view str,
const regex& pattern);
44 friend bool regex_search(std::string_view str, match_results& m,
const regex& pattern);
45 friend std::string
regex_replace(std::string_view str,
const regex& pattern, std::string_view repl);
51class match_results
final {
57 match_results(
const match_results&);
59 match_results& operator=(
const match_results&);
61 std::size_t size()
const;
62 std::string_view operator[](
int sub)
const;
66 utils::FastPimpl<Impl, 80, 8> impl_;
68 friend bool regex_match(std::string_view str,
const regex& pattern);
69 friend bool regex_match(std::string_view str, match_results& m,
const regex& pattern);
70 friend bool regex_search(std::string_view str,
const regex& pattern);
71 friend bool regex_search(std::string_view str, match_results& m,
const regex& pattern);
72 friend std::string
regex_replace(std::string_view str,
const regex& pattern, std::string_view repl);
81bool regex_match(std::string_view str, match_results& m,
const regex& pattern);
85bool regex_search(std::string_view str, match_results& m,
const regex& pattern);
93std::string
regex_replace(std::string_view str,
const regex& pattern, std::string_view repl);