tmp/tmpea30g8m7/{from.md → to.md}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
-
## Regular expression iterators <a id="re.iter">[[re.iter]]</a>
|
| 2 |
|
| 3 |
-
### Class template `regex_iterator` <a id="re.regiter">[[re.regiter]]</a>
|
| 4 |
|
| 5 |
-
#### General <a id="re.regiter.general">[[re.regiter.general]]</a>
|
| 6 |
|
| 7 |
The class template `regex_iterator` is an iterator adaptor. It
|
| 8 |
represents a new view of an existing iterator sequence, by enumerating
|
| 9 |
all the occurrences of a regular expression within that sequence. A
|
| 10 |
`regex_iterator` uses `regex_search` to find successive regular
|
|
@@ -15,11 +15,11 @@ the iterator finds and stores a value of
|
|
| 15 |
reached (`regex_search` returns `false`), the iterator becomes equal to
|
| 16 |
the end-of-sequence iterator value. The default constructor constructs
|
| 17 |
an end-of-sequence iterator object, which is the only legitimate
|
| 18 |
iterator to be used for the end condition. The result of `operator*` on
|
| 19 |
an end-of-sequence iterator is not defined. For any other iterator value
|
| 20 |
-
a const
|
| 21 |
of `operator->` on an end-of-sequence iterator is not defined. For any
|
| 22 |
other iterator value a `const match_results<BidirectionalIterator>*` is
|
| 23 |
returned. It is impossible to store things into `regex_iterator`s. Two
|
| 24 |
end-of-sequence iterators are always equal. An end-of-sequence iterator
|
| 25 |
is not equal to a non-end-of-sequence iterator. Two non-end-of-sequence
|
|
@@ -72,11 +72,11 @@ iterator holds a *zero-length match* if `match[0].matched == true` and
|
|
| 72 |
|
| 73 |
[*Note 1*: For example, this can occur when the part of the regular
|
| 74 |
expression that matched consists only of an assertion (such as `'^'`,
|
| 75 |
`'$'`, `'\b'`, `'\B'`). — *end note*]
|
| 76 |
|
| 77 |
-
#### Constructors <a id="re.regiter.cnstr">[[re.regiter.cnstr]]</a>
|
| 78 |
|
| 79 |
``` cpp
|
| 80 |
regex_iterator();
|
| 81 |
```
|
| 82 |
|
|
@@ -91,11 +91,11 @@ regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
|
|
| 91 |
*Effects:* Initializes `begin` and `end` to `a` and `b`, respectively,
|
| 92 |
sets `pregex` to `addressof(re)`, sets `flags` to `m`, then calls
|
| 93 |
`regex_search(begin, end, match, *pregex, flags)`. If this call returns
|
| 94 |
`false` the constructor sets `*this` to the end-of-sequence iterator.
|
| 95 |
|
| 96 |
-
#### Comparisons <a id="re.regiter.comp">[[re.regiter.comp]]</a>
|
| 97 |
|
| 98 |
``` cpp
|
| 99 |
bool operator==(const regex_iterator& right) const;
|
| 100 |
```
|
| 101 |
|
|
@@ -108,11 +108,11 @@ iterators or if the following conditions all hold:
|
|
| 108 |
- `flags == right.flags`, and
|
| 109 |
- `match[0] == right.match[0]`;
|
| 110 |
|
| 111 |
otherwise `false`.
|
| 112 |
|
| 113 |
-
#### Indirection <a id="re.regiter.deref">[[re.regiter.deref]]</a>
|
| 114 |
|
| 115 |
``` cpp
|
| 116 |
const value_type& operator*() const;
|
| 117 |
```
|
| 118 |
|
|
@@ -122,11 +122,11 @@ const value_type& operator*() const;
|
|
| 122 |
const value_type* operator->() const;
|
| 123 |
```
|
| 124 |
|
| 125 |
*Returns:* `addressof(match)`.
|
| 126 |
|
| 127 |
-
#### Increment <a id="re.regiter.incr">[[re.regiter.incr]]</a>
|
| 128 |
|
| 129 |
``` cpp
|
| 130 |
regex_iterator& operator++();
|
| 131 |
```
|
| 132 |
|
|
@@ -156,12 +156,12 @@ If the most recent match was not a zero-length match, the operator sets
|
|
| 156 |
`false` the iterator sets `*this` to the end-of-sequence iterator. The
|
| 157 |
iterator then returns `*this`.
|
| 158 |
|
| 159 |
In all cases in which the call to `regex_search` returns `true`,
|
| 160 |
`match.prefix().first` shall be equal to the previous value of
|
| 161 |
-
`match[0].second`, and for each index `i` in the half-open range
|
| 162 |
-
`
|
| 163 |
`match.position(i)` shall return `distance(begin, match[i].first)`.
|
| 164 |
|
| 165 |
[*Note 1*: This means that `match.position(i)` gives the offset from
|
| 166 |
the beginning of the target sequence, which is often not the same as the
|
| 167 |
offset from the sequence passed in the call to
|
|
@@ -183,13 +183,13 @@ regex_iterator operator++(int);
|
|
| 183 |
regex_iterator tmp = *this;
|
| 184 |
++(*this);
|
| 185 |
return tmp;
|
| 186 |
```
|
| 187 |
|
| 188 |
-
### Class template `regex_token_iterator` <a id="re.tokiter">[[re.tokiter]]</a>
|
| 189 |
|
| 190 |
-
#### General <a id="re.tokiter.general">[[re.tokiter.general]]</a>
|
| 191 |
|
| 192 |
The class template `regex_token_iterator` is an iterator adaptor; that
|
| 193 |
is to say it represents a new view of an existing iterator sequence, by
|
| 194 |
enumerating all the occurrences of a regular expression within that
|
| 195 |
sequence, and presenting one or more sub-expressions for each match
|
|
@@ -323,11 +323,11 @@ same as the end of the last match found, and `suffix.second` is the same
|
|
| 323 |
as the end of the target sequence. — *end note*]
|
| 324 |
|
| 325 |
The *current match* is `(*position).prefix()` if `subs[N] == -1`, or
|
| 326 |
`(*position)[subs[N]]` for any other value of `subs[N]`.
|
| 327 |
|
| 328 |
-
#### Constructors <a id="re.tokiter.cnstr">[[re.tokiter.cnstr]]</a>
|
| 329 |
|
| 330 |
``` cpp
|
| 331 |
regex_token_iterator();
|
| 332 |
```
|
| 333 |
|
|
@@ -371,11 +371,11 @@ end-of-sequence iterator the constructor sets `result` to the address of
|
|
| 371 |
the current match. Otherwise if any of the values stored in `subs` is
|
| 372 |
equal to -1 the constructor sets `*this` to a suffix iterator that
|
| 373 |
points to the range \[`a`, `b`), otherwise the constructor sets `*this`
|
| 374 |
to an end-of-sequence iterator.
|
| 375 |
|
| 376 |
-
#### Comparisons <a id="re.tokiter.comp">[[re.tokiter.comp]]</a>
|
| 377 |
|
| 378 |
``` cpp
|
| 379 |
bool operator==(const regex_token_iterator& right) const;
|
| 380 |
```
|
| 381 |
|
|
@@ -384,11 +384,11 @@ iterators, or if `*this` and `right` are both suffix iterators and
|
|
| 384 |
`suffix == right.suffix`; otherwise returns `false` if `*this` or
|
| 385 |
`right` is an end-of-sequence iterator or a suffix iterator. Otherwise
|
| 386 |
returns `true` if `position == right.position`, `N == right.N`, and
|
| 387 |
`subs == right.subs`. Otherwise returns `false`.
|
| 388 |
|
| 389 |
-
#### Indirection <a id="re.tokiter.deref">[[re.tokiter.deref]]</a>
|
| 390 |
|
| 391 |
``` cpp
|
| 392 |
const value_type& operator*() const;
|
| 393 |
```
|
| 394 |
|
|
@@ -398,11 +398,11 @@ const value_type& operator*() const;
|
|
| 398 |
const value_type* operator->() const;
|
| 399 |
```
|
| 400 |
|
| 401 |
*Returns:* `result`.
|
| 402 |
|
| 403 |
-
#### Increment <a id="re.tokiter.incr">[[re.tokiter.incr]]</a>
|
| 404 |
|
| 405 |
``` cpp
|
| 406 |
regex_token_iterator& operator++();
|
| 407 |
```
|
| 408 |
|
|
@@ -424,11 +424,11 @@ Otherwise, if any of the values stored in `subs` is equal to -1 and
|
|
| 424 |
iterator that points to the range \[`prev->suffix().first`,
|
| 425 |
`prev->suffix().second`).
|
| 426 |
|
| 427 |
Otherwise, sets `*this` to an end-of-sequence iterator.
|
| 428 |
|
| 429 |
-
*Returns:* `*this`
|
| 430 |
|
| 431 |
``` cpp
|
| 432 |
regex_token_iterator& operator++(int);
|
| 433 |
```
|
| 434 |
|
|
|
|
| 1 |
+
### Regular expression iterators <a id="re.iter">[[re.iter]]</a>
|
| 2 |
|
| 3 |
+
#### Class template `regex_iterator` <a id="re.regiter">[[re.regiter]]</a>
|
| 4 |
|
| 5 |
+
##### General <a id="re.regiter.general">[[re.regiter.general]]</a>
|
| 6 |
|
| 7 |
The class template `regex_iterator` is an iterator adaptor. It
|
| 8 |
represents a new view of an existing iterator sequence, by enumerating
|
| 9 |
all the occurrences of a regular expression within that sequence. A
|
| 10 |
`regex_iterator` uses `regex_search` to find successive regular
|
|
|
|
| 15 |
reached (`regex_search` returns `false`), the iterator becomes equal to
|
| 16 |
the end-of-sequence iterator value. The default constructor constructs
|
| 17 |
an end-of-sequence iterator object, which is the only legitimate
|
| 18 |
iterator to be used for the end condition. The result of `operator*` on
|
| 19 |
an end-of-sequence iterator is not defined. For any other iterator value
|
| 20 |
+
a `const match_results<BidirectionalIterator>&` is returned. The result
|
| 21 |
of `operator->` on an end-of-sequence iterator is not defined. For any
|
| 22 |
other iterator value a `const match_results<BidirectionalIterator>*` is
|
| 23 |
returned. It is impossible to store things into `regex_iterator`s. Two
|
| 24 |
end-of-sequence iterators are always equal. An end-of-sequence iterator
|
| 25 |
is not equal to a non-end-of-sequence iterator. Two non-end-of-sequence
|
|
|
|
| 72 |
|
| 73 |
[*Note 1*: For example, this can occur when the part of the regular
|
| 74 |
expression that matched consists only of an assertion (such as `'^'`,
|
| 75 |
`'$'`, `'\b'`, `'\B'`). — *end note*]
|
| 76 |
|
| 77 |
+
##### Constructors <a id="re.regiter.cnstr">[[re.regiter.cnstr]]</a>
|
| 78 |
|
| 79 |
``` cpp
|
| 80 |
regex_iterator();
|
| 81 |
```
|
| 82 |
|
|
|
|
| 91 |
*Effects:* Initializes `begin` and `end` to `a` and `b`, respectively,
|
| 92 |
sets `pregex` to `addressof(re)`, sets `flags` to `m`, then calls
|
| 93 |
`regex_search(begin, end, match, *pregex, flags)`. If this call returns
|
| 94 |
`false` the constructor sets `*this` to the end-of-sequence iterator.
|
| 95 |
|
| 96 |
+
##### Comparisons <a id="re.regiter.comp">[[re.regiter.comp]]</a>
|
| 97 |
|
| 98 |
``` cpp
|
| 99 |
bool operator==(const regex_iterator& right) const;
|
| 100 |
```
|
| 101 |
|
|
|
|
| 108 |
- `flags == right.flags`, and
|
| 109 |
- `match[0] == right.match[0]`;
|
| 110 |
|
| 111 |
otherwise `false`.
|
| 112 |
|
| 113 |
+
##### Indirection <a id="re.regiter.deref">[[re.regiter.deref]]</a>
|
| 114 |
|
| 115 |
``` cpp
|
| 116 |
const value_type& operator*() const;
|
| 117 |
```
|
| 118 |
|
|
|
|
| 122 |
const value_type* operator->() const;
|
| 123 |
```
|
| 124 |
|
| 125 |
*Returns:* `addressof(match)`.
|
| 126 |
|
| 127 |
+
##### Increment <a id="re.regiter.incr">[[re.regiter.incr]]</a>
|
| 128 |
|
| 129 |
``` cpp
|
| 130 |
regex_iterator& operator++();
|
| 131 |
```
|
| 132 |
|
|
|
|
| 156 |
`false` the iterator sets `*this` to the end-of-sequence iterator. The
|
| 157 |
iterator then returns `*this`.
|
| 158 |
|
| 159 |
In all cases in which the call to `regex_search` returns `true`,
|
| 160 |
`match.prefix().first` shall be equal to the previous value of
|
| 161 |
+
`match[0].second`, and for each index `i` in the half-open range \[`0`,
|
| 162 |
+
`match.size()`) for which `match[i].matched` is `true`,
|
| 163 |
`match.position(i)` shall return `distance(begin, match[i].first)`.
|
| 164 |
|
| 165 |
[*Note 1*: This means that `match.position(i)` gives the offset from
|
| 166 |
the beginning of the target sequence, which is often not the same as the
|
| 167 |
offset from the sequence passed in the call to
|
|
|
|
| 183 |
regex_iterator tmp = *this;
|
| 184 |
++(*this);
|
| 185 |
return tmp;
|
| 186 |
```
|
| 187 |
|
| 188 |
+
#### Class template `regex_token_iterator` <a id="re.tokiter">[[re.tokiter]]</a>
|
| 189 |
|
| 190 |
+
##### General <a id="re.tokiter.general">[[re.tokiter.general]]</a>
|
| 191 |
|
| 192 |
The class template `regex_token_iterator` is an iterator adaptor; that
|
| 193 |
is to say it represents a new view of an existing iterator sequence, by
|
| 194 |
enumerating all the occurrences of a regular expression within that
|
| 195 |
sequence, and presenting one or more sub-expressions for each match
|
|
|
|
| 323 |
as the end of the target sequence. — *end note*]
|
| 324 |
|
| 325 |
The *current match* is `(*position).prefix()` if `subs[N] == -1`, or
|
| 326 |
`(*position)[subs[N]]` for any other value of `subs[N]`.
|
| 327 |
|
| 328 |
+
##### Constructors <a id="re.tokiter.cnstr">[[re.tokiter.cnstr]]</a>
|
| 329 |
|
| 330 |
``` cpp
|
| 331 |
regex_token_iterator();
|
| 332 |
```
|
| 333 |
|
|
|
|
| 371 |
the current match. Otherwise if any of the values stored in `subs` is
|
| 372 |
equal to -1 the constructor sets `*this` to a suffix iterator that
|
| 373 |
points to the range \[`a`, `b`), otherwise the constructor sets `*this`
|
| 374 |
to an end-of-sequence iterator.
|
| 375 |
|
| 376 |
+
##### Comparisons <a id="re.tokiter.comp">[[re.tokiter.comp]]</a>
|
| 377 |
|
| 378 |
``` cpp
|
| 379 |
bool operator==(const regex_token_iterator& right) const;
|
| 380 |
```
|
| 381 |
|
|
|
|
| 384 |
`suffix == right.suffix`; otherwise returns `false` if `*this` or
|
| 385 |
`right` is an end-of-sequence iterator or a suffix iterator. Otherwise
|
| 386 |
returns `true` if `position == right.position`, `N == right.N`, and
|
| 387 |
`subs == right.subs`. Otherwise returns `false`.
|
| 388 |
|
| 389 |
+
##### Indirection <a id="re.tokiter.deref">[[re.tokiter.deref]]</a>
|
| 390 |
|
| 391 |
``` cpp
|
| 392 |
const value_type& operator*() const;
|
| 393 |
```
|
| 394 |
|
|
|
|
| 398 |
const value_type* operator->() const;
|
| 399 |
```
|
| 400 |
|
| 401 |
*Returns:* `result`.
|
| 402 |
|
| 403 |
+
##### Increment <a id="re.tokiter.incr">[[re.tokiter.incr]]</a>
|
| 404 |
|
| 405 |
``` cpp
|
| 406 |
regex_token_iterator& operator++();
|
| 407 |
```
|
| 408 |
|
|
|
|
| 424 |
iterator that points to the range \[`prev->suffix().first`,
|
| 425 |
`prev->suffix().second`).
|
| 426 |
|
| 427 |
Otherwise, sets `*this` to an end-of-sequence iterator.
|
| 428 |
|
| 429 |
+
*Returns:* `*this`.
|
| 430 |
|
| 431 |
``` cpp
|
| 432 |
regex_token_iterator& operator++(int);
|
| 433 |
```
|
| 434 |
|