c-string/c-string (1) | template <class traits, class charT> basic_string<charT> regex_replace (const charT* s, const basic_regex<charT,traits>& rgx, const charT* fmt, regex_constants::match_flag_type flags = regex_constants::match_default); |
---|---|
c-string/string (2) | template <class traits, class charT, class ST, class SA> basic_string<charT> regex_replace (const charT*s, const basic_regex<charT,traits>& rgx, const basic_string<charT,ST,SA>& fmt, regex_constants::match_flag_type flags = regex_constants::match_default); |
string/c-string (3) | template <class traits, class charT, class ST, class SA> basic_string<charT,ST,SA> regex_replace (const basic_string<charT,ST,SA>& s, const basic_regex<charT,traits>& rgx, const charT* fmt, regex_constants::match_flag_type flags = regex_constants::match_default); |
string/string (4) | template <class traits, class charT, class ST, class SA, class FST, class FSA> basic_string<charT,ST,SA> regex_replace (const basic_string<charT,ST,SA>& s, const basic_regex<charT,traits>& rgx, const basic_string<charT,FST,FSA>& fmt, regex_constants::match_flag_type flags = regex_constants::match_default); |
range/c-string (5) | template <class OutputIterator, class BidirectionalIterator, class traits, class charT> OutputIterator regex_replace (OutputIterator out, BidirectionalIterator first, BidirectionalIterator last, const basic_regex<charT,traits>& rgx, const charT* fmt, regex_constants::match_flag_type flags = regex_constants::match_default); |
range/string (6) | template <class OutputIterator, class BidirectionalIterator, class traits, class charT, class ST, class SA> OutputIterator regex_replace (OutputIterator out, BidirectionalIterator first, BidirectionalIterator last, const basic_regex<charT,traits>& rgx, const basic_string<charT,ST,SA>& fmt, regex_constants::match_flag_type flags = regex_constants::match_default); |
characters | replacement |
---|---|
$n | n-th backreference (i.e., a copy of the n-th matched group specified with parentheses in the regex pattern). n must be an integer value designating a valid backreference, greater than 0, and of two digits at most. |
$& | A copy of the entire match |
$` | The prefix (i.e., the part of the target sequence that precedes the match). |
$ยด | The suffix (i.e., the part of the target sequence that follows the match). |
$$ | A single $ character. |
flag* | effects | notes |
---|---|---|
match_default | Default | Default matching behavior. This constant has a value of zero**. |
match_not_bol | Not Beginning-Of-Line | The first character is not considered a beginning of line ("^" does not match). |
match_not_eol | Not End-Of-Line | The last character is not considered an end of line ("$" does not match). |
match_not_bow | Not Beginning-Of-Word | The escape sequence "\b" does not match as a beginning-of-word. |
match_not_eow | Not End-Of-Word | The escape sequence "\b" does not match as an end-of-word. |
match_any | Any match | Any match is acceptable if more than one match is possible. |
match_not_null | Not null | Empty sequences do not match. |
match_continuous | Continuous | The expression must match a sub-sequence that begins at the first character. Sub-sequences must begin at the first character to match. |
match_prev_avail | Previous Available | One or more characters exist before the first one. (match_not_bol and match_not_bow are ignored) |
format_default | Default formatting | Uses the standard formatting rules to replace matches (those used by ECMAScript's replace method). This constant has a value of zero**. |
format_sed | sed formatting | Uses the same rules as the sed utility in POSIX to replace matches. |
format_no_copy | No copy | The sections in the target sequence that do not match the regular expression are not copied when replacing matches. |
format_first_only | First only | Only the first occurrence of a regular expression is replaced. |
|
|
there is a sub-sequence in the string there is a sequence in the string sub and sequence |