
please wait
(1) | string_type format (const char_type* fmt, regex_constants::match_flag_type flags = regex_constants::format_default ) const; |
---|---|
(2) | template <class sT, class sA> basic_string<char_type, sT, sA> format (const basic_string<char_type, sT, sA>& fmt, regex_constants::match_flag_type flags = regex_constants::format_default ) const; |
(3) | template <class OutputIterator, class sT, class sA> OutputIterator format ( OutputIterator out, const basic_string<char_type, sT, sA>& fmt, regex_constants::match_flag_type flags = regex_constants::format_default ) const; |
(4) | template <class OutputIterator> OuputIterator format ( OutputIterator out, const char_type* fmt_first, const char_type* fmt_last, regex_constants::match_flag_type flags = regex_constants::format_default ) const; |
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 1, 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 on format | notes |
---|---|---|
match_default | Default | Same as format_default. This constant has a value of zero**. |
match_not_bol | None | Ignored by this function. See regex_constants for more info. |
match_not_eol | ||
match_not_bow | ||
match_not_eow | ||
match_any | ||
match_not_null | ||
match_continuous | ||
match_prev_avail | ||
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. |
|
|
the expression matched [subject]. with sub-expressions [sub] and [ject]. |