From Jason Turner

[re.regex.construct]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpq4o2rdkh/{from.md → to.md} +38 -45
tmp/tmpq4o2rdkh/{from.md → to.md} RENAMED
@@ -1,100 +1,93 @@
1
- ### `basic_regex` constructors <a id="re.regex.construct">[[re.regex.construct]]</a>
2
 
3
  ``` cpp
4
  basic_regex();
5
  ```
6
 
7
- *Effects:* Constructs an object of class `basic_regex` that does not
8
- match any character sequence.
9
 
10
  ``` cpp
11
  explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
12
  ```
13
 
14
- *Requires:* `p` shall not be a null pointer.
 
15
 
16
- *Throws:* `regex_error` if `p` is not a valid regular expression.
 
 
 
17
 
18
- *Effects:* Constructs an object of class `basic_regex`; the object’s
19
- internal finite state machine is constructed from the regular expression
20
- contained in the array of `charT` of length
21
- `char_traits<charT>::length(p)` whose first element is designated by
22
- `p`, and interpreted according to the flags `f`.
23
 
24
- *Postconditions:* `flags()` returns `f`. `mark_count()` returns the
25
- number of marked sub-expressions within the expression.
26
 
27
  ``` cpp
28
- basic_regex(const charT* p, size_t len, flag_type f);
29
  ```
30
 
31
- *Requires:* `p` shall not be a null pointer.
32
 
33
- *Throws:* `regex_error` if `p` is not a valid regular expression.
 
 
34
 
35
- *Effects:* Constructs an object of class `basic_regex`; the object’s
36
- internal finite state machine is constructed from the regular expression
37
- contained in the sequence of characters \[`p`, `p+len`), and interpreted
38
- according the flags specified in `f`.
39
 
40
- *Postconditions:* `flags()` returns `f`. `mark_count()` returns the
41
- number of marked sub-expressions within the expression.
42
 
43
  ``` cpp
44
  basic_regex(const basic_regex& e);
45
  ```
46
 
47
- *Effects:* Constructs an object of class `basic_regex` as a copy of the
48
- object `e`.
49
-
50
- *Postconditions:* `flags()` and `mark_count()` return `e.flags()` and
51
  `e.mark_count()`, respectively.
52
 
53
  ``` cpp
54
  basic_regex(basic_regex&& e) noexcept;
55
  ```
56
 
57
- *Effects:* Move constructs an object of class `basic_regex` from `e`.
58
-
59
- *Postconditions:* `flags()` and `mark_count()` return the values that
60
  `e.flags()` and `e.mark_count()`, respectively, had before construction.
61
- `e` is in a valid state with unspecified value.
62
 
63
  ``` cpp
64
  template<class ST, class SA>
65
  explicit basic_regex(const basic_string<charT, ST, SA>& s,
66
  flag_type f = regex_constants::ECMAScript);
67
  ```
68
 
 
 
 
 
 
 
 
69
  *Throws:* `regex_error` if `s` is not a valid regular expression.
70
 
71
- *Effects:* Constructs an object of class `basic_regex`; the object’s
72
- internal finite state machine is constructed from the regular expression
73
- contained in the string `s`, and interpreted according to the flags
74
- specified in `f`.
75
-
76
- *Postconditions:* `flags()` returns `f`. `mark_count()` returns the
77
- number of marked sub-expressions within the expression.
78
-
79
  ``` cpp
80
  template<class ForwardIterator>
81
  basic_regex(ForwardIterator first, ForwardIterator last,
82
  flag_type f = regex_constants::ECMAScript);
83
  ```
84
 
 
 
 
 
 
 
 
 
85
  *Throws:* `regex_error` if the sequence \[`first`, `last`) is not a
86
  valid regular expression.
87
 
88
- *Effects:* Constructs an object of class `basic_regex`; the object’s
89
- internal finite state machine is constructed from the regular expression
90
- contained in the sequence of characters \[`first`, `last`), and
91
- interpreted according to the flags specified in `f`.
92
-
93
- *Postconditions:* `flags()` returns `f`. `mark_count()` returns the
94
- number of marked sub-expressions within the expression.
95
-
96
  ``` cpp
97
  basic_regex(initializer_list<charT> il, flag_type f = regex_constants::ECMAScript);
98
  ```
99
 
100
  *Effects:* Same as `basic_regex(il.begin(), il.end(), f)`.
 
1
+ ### Constructors <a id="re.regex.construct">[[re.regex.construct]]</a>
2
 
3
  ``` cpp
4
  basic_regex();
5
  ```
6
 
7
+ *Ensures:* `*this` does not match any character sequence.
 
8
 
9
  ``` cpp
10
  explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
11
  ```
12
 
13
+ *Preconditions:* \[`p`, `p + char_traits<charT>::length(p)`) is a valid
14
+ range.
15
 
16
+ *Effects:* The object’s internal finite state machine is constructed
17
+ from the regular expression contained in the sequence of characters
18
+ \[`p`, `p + char_traits<charT>::length(p)`), and interpreted according
19
+ to the flags `f`.
20
 
21
+ *Ensures:* `flags()` returns `f`. `mark_count()` returns the number of
22
+ marked sub-expressions within the expression.
 
 
 
23
 
24
+ *Throws:* `regex_error` if \[`p`, `p + char_traits<charT>::length(p)`)
25
+ is not a valid regular expression.
26
 
27
  ``` cpp
28
+ basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
29
  ```
30
 
31
+ *Preconditions:* \[`p`, `p + len`) is a valid range.
32
 
33
+ *Effects:* The object’s internal finite state machine is constructed
34
+ from the regular expression contained in the sequence of characters
35
+ \[`p`, `p + len`), and interpreted according the flags specified in `f`.
36
 
37
+ *Ensures:* `flags()` returns `f`. `mark_count()` returns the number of
38
+ marked sub-expressions within the expression.
 
 
39
 
40
+ *Throws:* `regex_error` if \[`p`, `p + len`) is not a valid regular
41
+ expression.
42
 
43
  ``` cpp
44
  basic_regex(const basic_regex& e);
45
  ```
46
 
47
+ *Ensures:* `flags()` and `mark_count()` return `e.flags()` and
 
 
 
48
  `e.mark_count()`, respectively.
49
 
50
  ``` cpp
51
  basic_regex(basic_regex&& e) noexcept;
52
  ```
53
 
54
+ *Ensures:* `flags()` and `mark_count()` return the values that
 
 
55
  `e.flags()` and `e.mark_count()`, respectively, had before construction.
 
56
 
57
  ``` cpp
58
  template<class ST, class SA>
59
  explicit basic_regex(const basic_string<charT, ST, SA>& s,
60
  flag_type f = regex_constants::ECMAScript);
61
  ```
62
 
63
+ *Effects:* The object’s internal finite state machine is constructed
64
+ from the regular expression contained in the string `s`, and interpreted
65
+ according to the flags specified in `f`.
66
+
67
+ *Ensures:* `flags()` returns `f`. `mark_count()` returns the number of
68
+ marked sub-expressions within the expression.
69
+
70
  *Throws:* `regex_error` if `s` is not a valid regular expression.
71
 
 
 
 
 
 
 
 
 
72
  ``` cpp
73
  template<class ForwardIterator>
74
  basic_regex(ForwardIterator first, ForwardIterator last,
75
  flag_type f = regex_constants::ECMAScript);
76
  ```
77
 
78
+ *Effects:* The object’s internal finite state machine is constructed
79
+ from the regular expression contained in the sequence of characters
80
+ \[`first`, `last`), and interpreted according to the flags specified in
81
+ `f`.
82
+
83
+ *Ensures:* `flags()` returns `f`. `mark_count()` returns the number of
84
+ marked sub-expressions within the expression.
85
+
86
  *Throws:* `regex_error` if the sequence \[`first`, `last`) is not a
87
  valid regular expression.
88
 
 
 
 
 
 
 
 
 
89
  ``` cpp
90
  basic_regex(initializer_list<charT> il, flag_type f = regex_constants::ECMAScript);
91
  ```
92
 
93
  *Effects:* Same as `basic_regex(il.begin(), il.end(), f)`.