REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
real::compat Namespace Reference

Drop-in replacements for <regex>, backed by REAL's linear-time engine where it can serve the pattern and by std::regex otherwise, never by a silent divergence. More...

Namespaces

namespace  detail
 Backend routing and format expansion for the compat layer. Not a stable API.
 
namespace  re2
 Drop-in replacement for RE2's API surface, on REAL's engine.
 
namespace  regex_constants
 Compatibility constants mirroring std::regex_constants (own values, mapped internally).
 

Classes

class  basic_regex
 A std::basic_regex-compatible pattern, backed by REAL where it can serve the pattern, else by std. More...
 
class  match_results
 The result of a match: group sub-matches plus the prefix and suffix. More...
 
class  regex_error
 std::regex_error-compatible exception; every regex error this layer reports has this type. More...
 
class  regex_iterator
 Iterates the non-overlapping matches of a pattern in a sequence (std::regex_iterator). More...
 
class  regex_token_iterator
 Enumerates selected sub-matches, or the text between matches (std::regex_token_iterator). More...
 
class  sub_match
 A matched sub-expression: a [first, second) range into the searched sequence. Any bidirectional iterator, as std::sub_match; only view needs contiguous storage. More...
 

Typedefs

using regex = basic_regex< char >
 The char-path compat regex (real-eligible).
 
using wregex = basic_regex< wchar_t >
 The wide compat regex (always the std backend).
 
using sregex_iterator = regex_iterator< std::string::const_iterator >
 Over a std::string.
 
using cregex_iterator = regex_iterator< const char * >
 Over a C string.
 
using wsregex_iterator = regex_iterator< std::wstring::const_iterator >
 Over a std::wstring (std).
 
using wcregex_iterator = regex_iterator< const wchar_t * >
 Over a wide C string (std).
 
using sregex_token_iterator = regex_token_iterator< std::string::const_iterator >
 Over a std::string.
 
using cregex_token_iterator = regex_token_iterator< const char * >
 Over a C string.
 
using wsregex_token_iterator = regex_token_iterator< std::wstring::const_iterator >
 Over a std::wstring (std).
 
using wcregex_token_iterator = regex_token_iterator< const wchar_t * >
 Over a wide C string (std).
 
using ssub_match = sub_match< std::string::const_iterator >
 Sub-match over a std::string.
 
using csub_match = sub_match< const char * >
 Sub-match over a C string.
 
using wssub_match = sub_match< std::wstring::const_iterator >
 Sub-match over a std::wstring.
 
using wcsub_match = sub_match< const wchar_t * >
 Sub-match over a wide C string.
 
using smatch = match_results< std::string::const_iterator >
 Match over a std::string.
 
using cmatch = match_results< const char * >
 Match over a C string.
 
using wsmatch = match_results< std::wstring::const_iterator >
 Match over a std::wstring (always std).
 
using wcmatch = match_results< const wchar_t * >
 Match over a wide C string (always std).
 

Enumerations

enum class  policy : std::uint8_t { strict , fallback }
 The policy for a pattern the linear engine cannot represent (a backreference, an unbounded lookbehind, a POSIX class, …): strict, the default, rejects it; fallback delegates it to std::regex, forfeiting the linear-time guarantee for that pattern. More...
 

Functions

template<typename BidirIt >
bool operator== (const sub_match< BidirIt > &lhs, const typename sub_match< BidirIt >::string_type &rhs)
 Equality against an owned string (the common std::sub_match comparison).
 
template<typename BidirIt >
bool operator== (const typename sub_match< BidirIt >::string_type &lhs, const sub_match< BidirIt > &rhs)
 Equality with the string on the left, for std::sub_match parity.
 
template<typename BidirIt >
bool operator== (const sub_match< BidirIt > &lhs, const sub_match< BidirIt > &rhs)
 Equality between two sub-matches, by matched text.
 
template<typename BidirIt >
auto operator<=> (const sub_match< BidirIt > &lhs, const sub_match< BidirIt > &rhs)
 Ordering between two sub-matches, by matched text (std::sub_match parity).
 
template<typename BidirIt >
auto operator<=> (const sub_match< BidirIt > &lhs, const typename sub_match< BidirIt >::string_type &rhs)
 Ordering against an owned string; the reversed and the <, > forms follow from it.
 
template<typename BidirIt >
bool operator== (const sub_match< BidirIt > &lhs, const typename sub_match< BidirIt >::value_type *rhs)
 Equality against a C string.
 
template<typename BidirIt >
auto operator<=> (const sub_match< BidirIt > &lhs, const typename sub_match< BidirIt >::value_type *rhs)
 Ordering against a C string.
 
template<typename BidirIt >
bool operator== (const sub_match< BidirIt > &lhs, const typename sub_match< BidirIt >::value_type &rhs)
 Equality against one character: the sub-match holds exactly it.
 
template<typename BidirIt >
auto operator<=> (const sub_match< BidirIt > &lhs, const typename sub_match< BidirIt >::value_type &rhs)
 Ordering against one character, as against the string holding only it.
 
template<typename CharT , typename Traits , typename BidirIt >
std::basic_ostream< CharT, Traits > & operator<< (std::basic_ostream< CharT, Traits > &os, const sub_match< BidirIt > &m)
 Streams m.str(), empty when the group did not participate (std::sub_match parity).
 
template<typename BidirIt , typename Alloc >
bool operator== (const match_results< BidirIt, Alloc > &lhs, const match_results< BidirIt, Alloc > &rhs)
 Equality of two results (std::match_results parity): both not ready, or both ready and both empty, or both holding the same text in the prefix, every group and the suffix.
 
template<typename BidirIt , typename Alloc >
void swap (match_results< BidirIt, Alloc > &lhs, match_results< BidirIt, Alloc > &rhs) noexcept
 Exchanges two results (std::swap parity).
 
template<typename BidirIt , typename CharT , typename Traits >
bool regex_search (BidirIt first, BidirIt last, match_results< BidirIt > &m, const basic_regex< CharT, Traits > &re, regex_constants::match_flag_type flags=regex_constants::match_default)
 Leftmost search of [first, last), as std::regex_search; the overloads taking no match_results skip capture filling.
 
template<typename CharT , typename Traits >
bool regex_search (const std::basic_string< CharT > &s, match_results< typename std::basic_string< CharT >::const_iterator > &m, const basic_regex< CharT, Traits > &re, regex_constants::match_flag_type flags=regex_constants::match_default)
 Leftmost search over a std::basic_string, as the primary overload.
 
template<typename CharT , typename Traits >
bool regex_search (const CharT *s, match_results< const CharT * > &m, const basic_regex< CharT, Traits > &re, regex_constants::match_flag_type flags=regex_constants::match_default)
 Leftmost search over a C string, as the primary overload.
 
template<typename BidirIt , typename CharT , typename Traits >
bool regex_search (BidirIt first, BidirIt last, const basic_regex< CharT, Traits > &re, regex_constants::match_flag_type flags=regex_constants::match_default)
 Leftmost search over [first, last), without capturing, as the primary overload.
 
template<typename CharT , typename Traits >
bool regex_search (const std::basic_string< CharT > &s, const basic_regex< CharT, Traits > &re, regex_constants::match_flag_type flags=regex_constants::match_default)
 Leftmost search over a std::basic_string, without capturing, as the primary overload.
 
template<typename CharT , typename Traits >
bool regex_search (const CharT *s, const basic_regex< CharT, Traits > &re, regex_constants::match_flag_type flags=regex_constants::match_default)
 Leftmost search over a C string, without capturing, as the primary overload.
 
template<typename BidirIt , typename CharT , typename Traits >
bool regex_match (BidirIt first, BidirIt last, match_results< BidirIt > &m, const basic_regex< CharT, Traits > &re, regex_constants::match_flag_type flags=regex_constants::match_default)
 Match of the entire [first, last), as std::regex_match; the overloads taking no match_results skip capture filling.
 
template<typename CharT , typename Traits >
bool regex_match (const std::basic_string< CharT > &s, match_results< typename std::basic_string< CharT >::const_iterator > &m, const basic_regex< CharT, Traits > &re, regex_constants::match_flag_type flags=regex_constants::match_default)
 Whole-sequence match over a std::basic_string, as the primary overload.
 
template<typename CharT , typename Traits >
bool regex_match (const CharT *s, match_results< const CharT * > &m, const basic_regex< CharT, Traits > &re, regex_constants::match_flag_type flags=regex_constants::match_default)
 Whole-sequence match over a C string, as the primary overload.
 
template<typename BidirIt , typename CharT , typename Traits >
bool regex_match (BidirIt first, BidirIt last, const basic_regex< CharT, Traits > &re, regex_constants::match_flag_type flags=regex_constants::match_default)
 Whole-sequence match over [first, last), without capturing, as the primary overload.
 
template<typename CharT , typename Traits >
bool regex_match (const std::basic_string< CharT > &s, const basic_regex< CharT, Traits > &re, regex_constants::match_flag_type flags=regex_constants::match_default)
 Whole-sequence match over a std::basic_string, without capturing, as the primary overload.
 
template<typename CharT , typename Traits >
bool regex_match (const CharT *s, const basic_regex< CharT, Traits > &re, regex_constants::match_flag_type flags=regex_constants::match_default)
 Whole-sequence match over a C string, without capturing, as the primary overload.
 
template<typename CharT , typename Traits >
bool regex_search (const std::basic_string< CharT > &&, match_results< typename std::basic_string< CharT >::const_iterator > &, const basic_regex< CharT, Traits > &)=delete
 
template<typename CharT , typename Traits >
bool regex_search (const std::basic_string< CharT > &&, match_results< typename std::basic_string< CharT >::const_iterator > &, const basic_regex< CharT, Traits > &, regex_constants::match_flag_type)=delete
 
template<typename CharT , typename Traits >
bool regex_match (const std::basic_string< CharT > &&, match_results< typename std::basic_string< CharT >::const_iterator > &, const basic_regex< CharT, Traits > &)=delete
 
template<typename CharT , typename Traits >
bool regex_match (const std::basic_string< CharT > &&, match_results< typename std::basic_string< CharT >::const_iterator > &, const basic_regex< CharT, Traits > &, regex_constants::match_flag_type)=delete
 
template<typename CharT , typename Traits >
std::basic_string< CharT > regex_replace (const std::basic_string< CharT > &s, const basic_regex< CharT, Traits > &re, const std::basic_string< CharT > &fmt, regex_constants::match_flag_type flags=regex_constants::format_default)
 Replaces matches of re in s with the formatted fmt; the other overloads forward here.
 
template<typename CharT , typename Traits >
std::basic_string< CharT > regex_replace (const std::basic_string< CharT > &s, const basic_regex< CharT, Traits > &re, const CharT *fmt, regex_constants::match_flag_type flags=regex_constants::format_default)
 regex_replace overload for a C-string format.
 
template<typename OutputIt , typename BidirIt , typename CharT , typename Traits >
OutputIt regex_replace (OutputIt out, BidirIt first, BidirIt last, const basic_regex< CharT, Traits > &re, const std::basic_string< CharT > &fmt, regex_constants::match_flag_type flags=regex_constants::format_default)
 regex_replace writing to an output iterator (std parity).
 
template<typename OutputIt , typename BidirIt , typename CharT , typename Traits >
OutputIt regex_replace (OutputIt out, BidirIt first, BidirIt last, const basic_regex< CharT, Traits > &re, const CharT *fmt, regex_constants::match_flag_type flags=regex_constants::format_default)
 regex_replace to an output iterator with a C-string format, so a string literal binds (std parity).
 

Detailed Description

Drop-in replacements for <regex>, backed by REAL's linear-time engine where it can serve the pattern and by std::regex otherwise, never by a silent divergence.

Enumeration Type Documentation

◆ policy

enum class real::compat::policy : std::uint8_t
strong

The policy for a pattern the linear engine cannot represent (a backreference, an unbounded lookbehind, a POSIX class, …): strict, the default, rejects it; fallback delegates it to std::regex, forfeiting the linear-time guarantee for that pattern.

The guarantee covers the calls REAL runs (replace and iteration compose them: quadratic at worst, never exponential). A call routed to std — a match flag REAL cannot honor, a $0 format, a traversal REAL does not model (basic_regex::uses_real_traversal) — runs on std's backtracker under either policy.

Enumerator
strict 

Reject an ineligible pattern (throws regex_error with error_complexity). The default.

fallback 

Delegate an ineligible pattern to std::regex (backtracking — not ReDoS-safe).

Function Documentation

◆ operator<<()

template<typename CharT , typename Traits , typename BidirIt >
std::basic_ostream< CharT, Traits > & real::compat::operator<< ( std::basic_ostream< CharT, Traits > &  os,
const sub_match< BidirIt > &  m 
)

Streams m.str(), empty when the group did not participate (std::sub_match parity).

Parameters
[in,out]osThe stream.
[in]mThe sub-match whose text is written.
Returns
os, after writing.

◆ operator<=>() [1/4]

template<typename BidirIt >
auto real::compat::operator<=> ( const sub_match< BidirIt > &  lhs,
const sub_match< BidirIt > &  rhs 
)

Ordering between two sub-matches, by matched text (std::sub_match parity).

Parameters
[in]lhsThe left sub-match.
[in]rhsThe right sub-match.
Returns
How lhs.str() orders against rhs.str().

◆ operator<=>() [2/4]

template<typename BidirIt >
auto real::compat::operator<=> ( const sub_match< BidirIt > &  lhs,
const typename sub_match< BidirIt >::string_type &  rhs 
)

Ordering against an owned string; the reversed and the <, > forms follow from it.

Parameters
[in]lhsThe sub-match.
[in]rhsThe string.
Returns
How lhs.str() orders against rhs.

◆ operator<=>() [3/4]

template<typename BidirIt >
auto real::compat::operator<=> ( const sub_match< BidirIt > &  lhs,
const typename sub_match< BidirIt >::value_type &  rhs 
)

Ordering against one character, as against the string holding only it.

Parameters
[in]lhsThe sub-match.
[in]rhsThe character.
Returns
How lhs.str() orders against that string.

◆ operator<=>() [4/4]

template<typename BidirIt >
auto real::compat::operator<=> ( const sub_match< BidirIt > &  lhs,
const typename sub_match< BidirIt >::value_type *  rhs 
)

Ordering against a C string.

Parameters
[in]lhsThe sub-match.
[in]rhsThe NUL-terminated string.
Returns
How lhs.str() orders against rhs.

◆ operator==() [1/6]

template<typename BidirIt , typename Alloc >
bool real::compat::operator== ( const match_results< BidirIt, Alloc > &  lhs,
const match_results< BidirIt, Alloc > &  rhs 
)

Equality of two results (std::match_results parity): both not ready, or both ready and both empty, or both holding the same text in the prefix, every group and the suffix.

Parameters
[in]lhsThe left result.
[in]rhsThe right result.
Returns
true when they are equal in that sense.

◆ operator==() [2/6]

template<typename BidirIt >
bool real::compat::operator== ( const sub_match< BidirIt > &  lhs,
const sub_match< BidirIt > &  rhs 
)

Equality between two sub-matches, by matched text.

Parameters
[in]lhsThe left sub-match.
[in]rhsThe right sub-match.
Returns
true if they hold the same characters.

◆ operator==() [3/6]

template<typename BidirIt >
bool real::compat::operator== ( const sub_match< BidirIt > &  lhs,
const typename sub_match< BidirIt >::string_type &  rhs 
)

Equality against an owned string (the common std::sub_match comparison).

Parameters
[in]lhsThe sub-match.
[in]rhsThe string to compare its text against.
Returns
true if they hold the same characters.

◆ operator==() [4/6]

template<typename BidirIt >
bool real::compat::operator== ( const sub_match< BidirIt > &  lhs,
const typename sub_match< BidirIt >::value_type &  rhs 
)

Equality against one character: the sub-match holds exactly it.

Parameters
[in]lhsThe sub-match.
[in]rhsThe character.
Returns
true if the matched text is that one character.

◆ operator==() [5/6]

template<typename BidirIt >
bool real::compat::operator== ( const sub_match< BidirIt > &  lhs,
const typename sub_match< BidirIt >::value_type *  rhs 
)

Equality against a C string.

Parameters
[in]lhsThe sub-match.
[in]rhsThe NUL-terminated string.
Returns
true if they hold the same characters.

◆ operator==() [6/6]

template<typename BidirIt >
bool real::compat::operator== ( const typename sub_match< BidirIt >::string_type &  lhs,
const sub_match< BidirIt > &  rhs 
)

Equality with the string on the left, for std::sub_match parity.

Parameters
[in]lhsThe string.
[in]rhsThe sub-match whose text is compared.
Returns
true if they hold the same characters.

◆ regex_match() [1/6]

template<typename BidirIt , typename CharT , typename Traits >
bool real::compat::regex_match ( BidirIt  first,
BidirIt  last,
const basic_regex< CharT, Traits > &  re,
regex_constants::match_flag_type  flags = regex_constants::match_default 
)

Whole-sequence match over [first, last), without capturing, as the primary overload.

Parameters
[in]firstStart of the sequence.
[in]lastOne past its end.
[in]reThe pattern.
[in]flagsMatch flags.
Returns
true if the whole sequence matched.

◆ regex_match() [2/6]

template<typename BidirIt , typename CharT , typename Traits >
bool real::compat::regex_match ( BidirIt  first,
BidirIt  last,
match_results< BidirIt > &  m,
const basic_regex< CharT, Traits > &  re,
regex_constants::match_flag_type  flags = regex_constants::match_default 
)

Match of the entire [first, last), as std::regex_match; the overloads taking no match_results skip capture filling.

Parameters
[in]firstStart of the sequence that must match in full.
[in]lastOne past its end.
[out]mResult filled on success; ready-but-unmatched on failure.
[in]reThe pattern.
[in]flagsMatch flags; a constraining one routes to std.
Returns
true if the whole sequence matched.

◆ regex_match() [3/6]

template<typename CharT , typename Traits >
bool real::compat::regex_match ( const CharT *  s,
const basic_regex< CharT, Traits > &  re,
regex_constants::match_flag_type  flags = regex_constants::match_default 
)

Whole-sequence match over a C string, without capturing, as the primary overload.

Parameters
[in]sThe subject.
[in]reThe pattern.
[in]flagsMatch flags.
Returns
true if the whole sequence matched.

◆ regex_match() [4/6]

template<typename CharT , typename Traits >
bool real::compat::regex_match ( const CharT *  s,
match_results< const CharT * > &  m,
const basic_regex< CharT, Traits > &  re,
regex_constants::match_flag_type  flags = regex_constants::match_default 
)

Whole-sequence match over a C string, as the primary overload.

Parameters
[in]sThe subject.
[out]mResult filled on success.
[in]reThe pattern.
[in]flagsMatch flags.
Returns
true if the whole sequence matched.

◆ regex_match() [5/6]

template<typename CharT , typename Traits >
bool real::compat::regex_match ( const std::basic_string< CharT > &  s,
const basic_regex< CharT, Traits > &  re,
regex_constants::match_flag_type  flags = regex_constants::match_default 
)

Whole-sequence match over a std::basic_string, without capturing, as the primary overload.

Parameters
[in]sThe subject.
[in]reThe pattern.
[in]flagsMatch flags.
Returns
true if the whole sequence matched.

◆ regex_match() [6/6]

template<typename CharT , typename Traits >
bool real::compat::regex_match ( const std::basic_string< CharT > &  s,
match_results< typename std::basic_string< CharT >::const_iterator > &  m,
const basic_regex< CharT, Traits > &  re,
regex_constants::match_flag_type  flags = regex_constants::match_default 
)

Whole-sequence match over a std::basic_string, as the primary overload.

Parameters
[in]sThe subject.
[out]mResult filled on success.
[in]reThe pattern.
[in]flagsMatch flags.
Returns
true if the whole sequence matched.

◆ regex_replace() [1/4]

template<typename CharT , typename Traits >
std::basic_string< CharT > real::compat::regex_replace ( const std::basic_string< CharT > &  s,
const basic_regex< CharT, Traits > &  re,
const CharT *  fmt,
regex_constants::match_flag_type  flags = regex_constants::format_default 
)

regex_replace overload for a C-string format.

Parameters
[in]sThe subject.
[in]reThe pattern whose matches are replaced.
[in]fmtECMAScript replacement format, as a C string.
[in]flagsMatch/format flags.
Returns
The subject with every match replaced.

◆ regex_replace() [2/4]

template<typename CharT , typename Traits >
std::basic_string< CharT > real::compat::regex_replace ( const std::basic_string< CharT > &  s,
const basic_regex< CharT, Traits > &  re,
const std::basic_string< CharT > &  fmt,
regex_constants::match_flag_type  flags = regex_constants::format_default 
)

Replaces matches of re in s with the formatted fmt; the other overloads forward here.

Runs on real when basic_regex::uses_real_traversal holds; a constraining flag or an ECMAScript $0 routes to std::regex_replace.

Parameters
[in]sThe subject.
[in]reThe pattern whose matches are replaced.
[in]fmtECMAScript replacement format; $N refers to a group, $& to the whole match.
[in]flagsMatch/format flags; one the real expander does not honor routes to std.
Returns
The subject with every match replaced.

◆ regex_replace() [3/4]

template<typename OutputIt , typename BidirIt , typename CharT , typename Traits >
OutputIt real::compat::regex_replace ( OutputIt  out,
BidirIt  first,
BidirIt  last,
const basic_regex< CharT, Traits > &  re,
const CharT *  fmt,
regex_constants::match_flag_type  flags = regex_constants::format_default 
)

regex_replace to an output iterator with a C-string format, so a string literal binds (std parity).

Parameters
[out]outDestination the result is written through.
[in]firstStart of the subject sequence.
[in]lastOne past its end.
[in]reThe pattern whose matches are replaced.
[in]fmtECMAScript replacement format, as a C string.
[in]flagsMatch/format flags.
Returns
out advanced past what was written.

◆ regex_replace() [4/4]

template<typename OutputIt , typename BidirIt , typename CharT , typename Traits >
OutputIt real::compat::regex_replace ( OutputIt  out,
BidirIt  first,
BidirIt  last,
const basic_regex< CharT, Traits > &  re,
const std::basic_string< CharT > &  fmt,
regex_constants::match_flag_type  flags = regex_constants::format_default 
)

regex_replace writing to an output iterator (std parity).

Parameters
[out]outDestination the result is written through.
[in]firstStart of the subject sequence.
[in]lastOne past its end.
[in]reThe pattern whose matches are replaced.
[in]fmtECMAScript replacement format.
[in]flagsMatch/format flags.
Returns
out advanced past what was written.

◆ regex_search() [1/6]

template<typename BidirIt , typename CharT , typename Traits >
bool real::compat::regex_search ( BidirIt  first,
BidirIt  last,
const basic_regex< CharT, Traits > &  re,
regex_constants::match_flag_type  flags = regex_constants::match_default 
)

Leftmost search over [first, last), without capturing, as the primary overload.

Parameters
[in]firstStart of the sequence.
[in]lastOne past its end.
[in]reThe pattern.
[in]flagsMatch flags.
Returns
true if a match was found.

◆ regex_search() [2/6]

template<typename BidirIt , typename CharT , typename Traits >
bool real::compat::regex_search ( BidirIt  first,
BidirIt  last,
match_results< BidirIt > &  m,
const basic_regex< CharT, Traits > &  re,
regex_constants::match_flag_type  flags = regex_constants::match_default 
)

Leftmost search of [first, last), as std::regex_search; the overloads taking no match_results skip capture filling.

Parameters
[in]firstStart of the sequence to search.
[in]lastOne past its end.
[out]mResult filled on success; ready-but-unmatched on failure, as std leaves it.
[in]reThe pattern.
[in]flagsMatch flags; a constraining one routes to std.
Returns
true if a match was found.

◆ regex_search() [3/6]

template<typename CharT , typename Traits >
bool real::compat::regex_search ( const CharT *  s,
const basic_regex< CharT, Traits > &  re,
regex_constants::match_flag_type  flags = regex_constants::match_default 
)

Leftmost search over a C string, without capturing, as the primary overload.

Parameters
[in]sThe subject.
[in]reThe pattern.
[in]flagsMatch flags.
Returns
true if a match was found.

◆ regex_search() [4/6]

template<typename CharT , typename Traits >
bool real::compat::regex_search ( const CharT *  s,
match_results< const CharT * > &  m,
const basic_regex< CharT, Traits > &  re,
regex_constants::match_flag_type  flags = regex_constants::match_default 
)

Leftmost search over a C string, as the primary overload.

Parameters
[in]sThe subject.
[out]mResult filled on success.
[in]reThe pattern.
[in]flagsMatch flags.
Returns
true if a match was found.

◆ regex_search() [5/6]

template<typename CharT , typename Traits >
bool real::compat::regex_search ( const std::basic_string< CharT > &  s,
const basic_regex< CharT, Traits > &  re,
regex_constants::match_flag_type  flags = regex_constants::match_default 
)

Leftmost search over a std::basic_string, without capturing, as the primary overload.

Parameters
[in]sThe subject.
[in]reThe pattern.
[in]flagsMatch flags.
Returns
true if a match was found.

◆ regex_search() [6/6]

template<typename CharT , typename Traits >
bool real::compat::regex_search ( const std::basic_string< CharT > &  s,
match_results< typename std::basic_string< CharT >::const_iterator > &  m,
const basic_regex< CharT, Traits > &  re,
regex_constants::match_flag_type  flags = regex_constants::match_default 
)

Leftmost search over a std::basic_string, as the primary overload.

Parameters
[in]sThe subject.
[out]mResult filled on success.
[in]reThe pattern.
[in]flagsMatch flags.
Returns
true if a match was found.

◆ swap()

template<typename BidirIt , typename Alloc >
void real::compat::swap ( match_results< BidirIt, Alloc > &  lhs,
match_results< BidirIt, Alloc > &  rhs 
)
noexcept

Exchanges two results (std::swap parity).

Parameters
[in,out]lhsOne result.
[in,out]rhsThe other.