1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
Before using the functions presented in this section the tthi(regex) header
file must be included.
There are three major families of functions that can be used to match a target
text against a regular expression. Each of these functions, as well as the
tt(match_results::format) member, has a final
tt(std::regex_constants::match_flag_type) parameter (see the next section),
which is given the default value tt(regex_constants::match_default) which can
be used to fine-tune the way the regular expression and the matching process
is being used. This
final parameter is not explicitly mentioned with the regular expression
matching functions or with the tt(format) member. The three families of
functions are:
itemization(
ithtq(regex_match)(bool std::regex_match(Parameters))
(This family of functions is used to match a regular expression against
a target text. Only if the regular expression matches the full target
text tt(true) is returned; otherwise tt(false) is returned. Refer to
section ref(REGMATCH) for an overview of the available overloaded
tt(regex_match) functions;)
ithtq(regex_search)(bool std::regex_search(Parameters))
(This family of functions is also used to match a regular expression
against a target text. This function returns true once the regular
expression matches a sub-string of the target text; otherwise
tt(false) is returned. See below for an overview of the available
overloaded tt(regex_search) functions;)
ithtq(regex_replace)(ReturnType std::regex_replace(Parameters))
(This family of functions is used to produce modified texts, using the
characters of a target string, a tt(regex) object and a format
string. This member closely resembles the functionality of the
tt(match_results::format) member discussed in section ref(FORMAT).)
)
The tt(match_results::format) member can be used after tt(regex_replace)
and is discussed after covering tt(regex_replace) (section ref(FORMAT)).
|