From Jason Turner

[re.alg.replace]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp57jrm0gr/{from.md → to.md} +36 -12
tmp/tmp57jrm0gr/{from.md → to.md} RENAMED
@@ -20,26 +20,50 @@ template <class OutputIterator, class BidirectionalIterator,
20
  regex_constants::match_flag_type flags =
21
  regex_constants::match_default);
22
  ```
23
 
24
  *Effects:* Constructs a `regex_iterator` object `i` as if by
25
- `regex_iterator<BidirectionalIterator, charT, traits> i(first, last, e, flags)`,
 
 
 
 
26
  and uses `i` to enumerate through all of the matches `m` of type
27
  `match_results<BidirectionalIterator>` that occur within the sequence
28
  \[`first`, `last`). If no such matches are found and
29
- `!(flags & regex_constants ``format_no_copy)` then calls
30
- `std::copy(first, last, out)`. If any matches are found then, for each
31
- such match, if `!(flags & regex_constants::format_no_copy)`, calls
32
- `std::copy(m.prefix().first, m.prefix().second, out)`, and then calls
33
- `m.format(out, fmt, flags)` for the first form of the function and
34
- `m.format(out,` `fmt, fmt + char_traits<charT>::length(fmt), flags)` for
35
- the second.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  Finally, if such a match is found and
38
- `!(flags & regex_constants ``format_no_copy)`, calls
39
- `std::copy(last_m.suffix().first, last_m.suffix().second, out)` where
40
- `last_m` is a copy of the last match found. If
 
 
 
 
41
  `flags & regex_constants::format_first_only` is non-zero then only the
42
  first match found is replaced.
43
 
44
  *Returns:* `out`.
45
 
@@ -66,11 +90,11 @@ template <class traits, class charT, class ST, class SA>
66
 
67
  *Returns:*  `result`.
68
 
69
  ``` cpp
70
  template <class traits, class charT, class ST, class SA>
71
- basic_string<charT>}
72
  regex_replace(const charT* s,
73
  const basic_regex<charT, traits>& e,
74
  const basic_string<charT, ST, SA>& fmt,
75
  regex_constants::match_flag_type flags =
76
  regex_constants::match_default);
 
20
  regex_constants::match_flag_type flags =
21
  regex_constants::match_default);
22
  ```
23
 
24
  *Effects:* Constructs a `regex_iterator` object `i` as if by
25
+
26
+ ``` cpp
27
+ regex_iterator<BidirectionalIterator, charT, traits> i(first, last, e, flags)
28
+ ```
29
+
30
  and uses `i` to enumerate through all of the matches `m` of type
31
  `match_results<BidirectionalIterator>` that occur within the sequence
32
  \[`first`, `last`). If no such matches are found and
33
+ `!(flags & regex_constants::format_no_copy)` then calls
34
+
35
+ ``` cpp
36
+ out = std::copy(first, last, out)
37
+ ```
38
+
39
+ If any matches are found then, for each such match:
40
+
41
+ - If `!(flags & regex_constants::format_no_copy)`, calls
42
+ ``` cpp
43
+ out = std::copy(m.prefix().first, m.prefix().second, out)
44
+ ```
45
+ - Then calls
46
+ ``` cpp
47
+ out = m.format(out, fmt, flags)
48
+ ```
49
+
50
+ for the first form of the function and
51
+ ``` cpp
52
+ out = m.format(out, fmt, fmt + char_traits<charT>::length(fmt), flags)
53
+ ```
54
+
55
+ for the second.
56
 
57
  Finally, if such a match is found and
58
+ `!(flags & regex_constants::format_no_copy)`, calls
59
+
60
+ ``` cpp
61
+ out = std::copy(last_m.suffix().first, last_m.suffix().second, out)
62
+ ```
63
+
64
+ where `last_m` is a copy of the last match found. If
65
  `flags & regex_constants::format_first_only` is non-zero then only the
66
  first match found is replaced.
67
 
68
  *Returns:* `out`.
69
 
 
90
 
91
  *Returns:*  `result`.
92
 
93
  ``` cpp
94
  template <class traits, class charT, class ST, class SA>
95
+ basic_string<charT>
96
  regex_replace(const charT* s,
97
  const basic_regex<charT, traits>& e,
98
  const basic_string<charT, ST, SA>& fmt,
99
  regex_constants::match_flag_type flags =
100
  regex_constants::match_default);