Represents one match of an sp::regex::Regex
with all its capture groups.
More...
#include <RegexMatch.hpp>
Public Member Functions | |
constexpr | RegexMatch (const RegexMatch &)=default |
constexpr RegexMatch & | operator= (const RegexMatch &)=default |
template<typename Name > | |
MatchRange & | getGroup () |
Access a capture group by name. More... | |
template<typename Name > | |
const MatchRange & | getGroup () const |
constexpr | operator bool () const |
Truthy if a match was found for the whole regex. More... | |
constexpr RegexMatch & | operator+= (int offset) |
Offset all non-enum ranges in this match by the given amount. More... | |
constexpr RegexMatch | operator+ (int offset) const |
constexpr RegexMatch & | operator-= (int offset) |
constexpr RegexMatch | operator- (int offset) const |
Public Member Functions inherited from sp::Vec< MatchRange, ParsedRegex::NumGroups > | |
constexpr int | size () const |
constexpr | Vec (E head, Es... tail) |
constexpr | Vec (const T(&arr)[InSize]) |
constexpr iterator | begin () |
constexpr const_iterator | begin () const |
constexpr iterator | end () |
constexpr const_iterator | end () const |
__host__ std::vector< T > | toVector () |
constexpr auto | toTuple () |
constexpr T & | operator[] (int i) |
constexpr const T & | operator[] (int i) const |
constexpr BareValueType | read (int i) const |
constexpr T & | get () |
constexpr const T & | get () const |
constexpr bool | operator== (const Vec< Q, OtherSize > &other) const |
constexpr auto | map (const Op &op=Op{}) const |
constexpr Vec< T, Size > | operator- () const |
constexpr Vec< T, Size > & | operator= (const Q &value) |
constexpr void | replace (T from, T to) |
constexpr T | reduce (Op op=Op{}) const |
constexpr Vec< T, NewSize > | slice (int start) const |
constexpr void | splice (int I, const Vec< T, InSize > &in) |
constexpr sp::Vec< T, Size+Len > | insert (const sp::Vec< T, Len > &newValues) const |
constexpr auto | insert (const T &newValue) const |
constexpr sp::Vec< T, Size > | reverse () const |
constexpr auto | erase () const |
constexpr auto | eraseLast () const |
constexpr auto | eraseFirst () const |
operator T () const | |
Additional Inherited Members | |
Static Public Member Functions inherited from sp::Vec< MatchRange, ParsedRegex::NumGroups > | |
static __host__ Vec< T, Size > | fromVector (const std::vector< T > &vector) |
static constexpr Vec< T, Size > | fromTuple (const std::tuple< Ts... > &tuple) |
static constexpr Vec< IT, sizeof...(Ints)> | fromIntegerSequence (sp::integer_sequence< IT, Ints... >) |
static constexpr Vec< T, Size > | copiesOf (const T &value) |
Represents one match of an sp::regex::Regex
with all its capture groups.
RegexMatch
inherits from sp::Vec
, and each of its members is a MatchRange
corresponding to a capture group, with the convention that group 0 represents the whole match. You may use all the usual sp::Vec
operators to interact with it.
ParsedRegex | - sp::regex::Regex::Parsed - The type of the parsed Regex pattern, containing information including how many capture groups it has, whether it has anchored starts or ends, etc. |
MatchRange & sp::regex::RegexMatch< ParsedRegex >::getGroup | ( | ) |
Access a capture group by name.
This is not for accessing groups by number. That can be done using operator[]
.
Name | A static string giving the name of the group you want to access. |
|
constexpr |
Truthy if a match was found for the whole regex.
Submatches may or may not be truthy, depending on if capture group results were requested and, if so, which groups participated in the match.
|
constexpr |
Offset all non-enum ranges in this match by the given amount.