Sub-match placeholder type, used to create named captures in static regexes. More...
#include <regex_primitives.hpp>
Public Member Functions | |
mark_tag (int mark_nbr) | |
Initialize a mark_tag placeholder. More... | |
operator detail::basic_mark_tag const & () const | |
INTERNAL ONLY. More... | |
Sub-match placeholder type, used to create named captures in static regexes.
mark_tag
is the type of the global sub-match placeholders s0
, s1
, etc.. You can use the mark_tag
type to create your own sub-match placeholders with more meaningful names. This is roughly equivalent to the "named capture" feature of dynamic regular expressions.
To create a named sub-match placeholder, initialize it with a unique integer. The integer must only be unique within the regex in which the placeholder is used. Then you can use it within static regexes to created sub-matches by assigning a sub-expression to it, or to refer back to already created sub-matches.
After a successful regex_match()
or regex_search()
, the sub-match placeholder can be used to index into the match_results<>
object to retrieve the corresponding sub-match.
|
inline |
Initialize a mark_tag placeholder.
mark_nbr | An integer that uniquely identifies this mark_tag within the static regexes in which this mark_tag will be used. |
mark_nbr > 0
References BOOST_ASSERT.
|
inline |
INTERNAL ONLY.