API === .. class:: ctll::fixed_string A compile-time fixed string. Example: :: static constexpr auto pattern = ctll::fixed_string{ "h.*" }; constexpr auto match(std::string_view sv) noexcept { return ctre::match(sv); } .. class:: template ctre::regex_results .. type:: char_type = typename std::iterator_traits::value_type The character type used by the ``Iterator``. .. function:: template constexpr captured_content::storage get() template constexpr captured_content::storage get() template constexpr captured_content::storage get() Returns the capture specified by ``Id`` or ``Name``. ID ``0`` is the full match, ID ``1`` is the first capture group, ID ``2`` is the second, etc. Named groups are specified using ``(?)``. Example: :: if (auto m = ctre::match<"(?[a-z]+)([0-9]+)">("abc123")) { m.get<"chars">(); //abc m.get<2>(); //123 } .. function:: constexpr size_t size() Returns the number of captures in this result object. .. function:: constexpr operator bool() const noexcept Returns whether the match was successful. .. function:: constexpr operator std::basic_string_view() const noexcept constexpr std::basic_string_view to_view() const noexcept constexpr std::basic_string_view view() const noexcept Converts the match to a string view. .. function:: constexpr explicit operator std::basic_string() const noexcept constexpr std::basic_string to_string() const noexcept constexpr std::basic_string str() const noexcept Converts the match to a string view. .. class:: template captured_content .. class:: template storage .. function:: constexpr auto begin() const noexcept constexpr auto end() const noexcept Returns the begin or end iterator for the captured content. .. function:: constexpr operator bool() const noexcept Returns whether the match was successful. .. function:: constexpr auto size() const noexcept Returns the number of characters in the capture. .. function:: constexpr operator std::basic_string_view() const noexcept constexpr std::basic_string_view to_view() const noexcept constexpr std::basic_string_view view() const noexcept Converts the capture to a string view. .. function:: constexpr explicit operator std::basic_string() const noexcept constexpr std::basic_string to_string() const noexcept constexpr std::basic_string str() const noexcept Converts the capture to a string view. .. function:: constexpr static size_t get_id() noexcept Returns ``Id`` .. function:: template constexpr ctre::regex_results match(Args&&... args) template constexpr ctre::regex_results match(Args&&... args) Matches ``RE`` against the whole input. ``Args...`` must be either a string-like object with ``begin`` and ``end`` member functions, or a pair of forward iterators. .. function:: template constexpr ctre::regex_results search(Args&&... args) template constexpr ctre::regex_results search(Args&&... args) Searches for a match somewhere within the input. ``Args...`` must be either a string-like object with ``begin`` and ``end`` member functions, or a pair of forward iterators.