doxygen
|
Namespace for the regular expression functions. More...
Classes | |
class | Ex |
Class representing a regular expression. More... | |
class | Iterator |
Iterator class to iterator through matches. More... | |
class | Match |
Object representing the matching results. More... | |
class | PToken |
Class representing a token in the compiled regular expression token stream. More... | |
class | SubMatch |
Object representing the match results of a capture range. More... | |
Functions | |
bool | search (std::string_view str, Match &match, const Ex &re, size_t pos=0) |
Search in a given string str starting at position pos for a match against regular expression re. More... | |
bool | search (std::string_view str, const Ex &re, size_t pos=0) |
Search in a given string str starting at position pos for a match against regular expression re. More... | |
bool | match (std::string_view str, Match &match, const Ex &re) |
Matches a given string str for a match against regular expression re. More... | |
bool | match (std::string_view str, const Ex &re) |
Matches a given string str for a match against regular expression re. More... | |
std::string | replace (std::string_view str, const Ex &re, std::string_view replacement) |
Searching in a given input string for parts that match regular expression re and replaces those parts by string replacement. | |
Namespace for the regular expression functions.
Matches a given string str for a match against regular expression re.
Returns true iff a match was found for the whole string. Any capture groups are returned via the match object.
bool reg::match | ( | std::string_view | str, |
const Ex & | re | ||
) |
Matches a given string str for a match against regular expression re.
Returns true iff a match was found for the whole string.
Search in a given string str starting at position pos for a match against regular expression re.
Returns true iff a match was found. Details of what part of the string has matched is returned via the match object.
An example to show how to match all identifiers in a string.
produces:
bool reg::search | ( | std::string_view | str, |
const Ex & | re, | ||
size_t | pos = 0 |
||
) |
Search in a given string str starting at position pos for a match against regular expression re.
Returns true iff a match was found.