1std::regex_constants(3)    Library Functions Manual    std::regex_constants(3)
2
3
4

NAME

6       std::regex_constants -
7
8       ISO C++ 0x entities sub namespace for regex.
9
10

SYNOPSIS

12   5.2 Matching Rules
13        Matching a regular expression against a sequence of characters [first,
14       last) proceeds according to the rules of the grammar specified for the
15       regular expression object, modified according to the effects listed
16       below for any bitmask elements set.
17       enum __match_flag { _S_not_bol, _S_not_eol, _S_not_bow, _S_not_eow,
18           _S_any, _S_not_null, _S_continuous, _S_prev_avail, _S_sed,
19           _S_no_copy, _S_first_only, _S_match_flag_last }
20       typedef std::bitset< _S_match_flag_last > match_flag_type
21       static const match_flag_type format_default
22       static const match_flag_type format_first_only
23       static const match_flag_type format_no_copy
24       static const match_flag_type format_sed
25       static const match_flag_type match_any
26       static const match_flag_type match_continuous
27       static const match_flag_type match_default
28       static const match_flag_type match_not_bol
29       static const match_flag_type match_not_bow
30       static const match_flag_type match_not_eol
31       static const match_flag_type match_not_eow
32       static const match_flag_type match_not_null
33       static const match_flag_type match_prev_avail
34
35   5.1 Regular Expression Syntax Options
36       enum __syntax_option { _S_icase, _S_nosubs, _S_optimize, _S_collate,
37           _S_ECMAScript, _S_basic, _S_extended, _S_awk, _S_grep, _S_egrep,
38           _S_syntax_last }
39       typedef unsigned int syntax_option_type
40       static const syntax_option_type awk
41       static const syntax_option_type basic
42       static const syntax_option_type collate
43       static const syntax_option_type ECMAScript
44       static const syntax_option_type egrep
45       static const syntax_option_type extended
46       static const syntax_option_type grep
47       static const syntax_option_type icase
48       static const syntax_option_type nosubs
49       static const syntax_option_type optimize
50
51   5.3 Error Types
52       enum error_type { _S_error_collate, _S_error_ctype, _S_error_escape,
53           _S_error_backref, _S_error_brack, _S_error_paren, _S_error_brace,
54           _S_error_badbrace, _S_error_range, _S_error_space,
55           _S_error_badrepeat, _S_error_complexity, _S_error_stack,
56           _S_error_last }
57       static const error_type error_backref (_S_error_backref)
58       static const error_type error_badbrace (_S_error_badbrace)
59       static const error_type error_badrepeat (_S_error_badrepeat)
60       static const error_type error_brace (_S_error_brace)
61       static const error_type error_brack (_S_error_brack)
62       static const error_type error_collate (_S_error_collate)
63       static const error_type error_complexity (_S_error_complexity)
64       static const error_type error_ctype (_S_error_ctype)
65       static const error_type error_escape (_S_error_escape)
66       static const error_type error_paren (_S_error_paren)
67       static const error_type error_range (_S_error_range)
68       static const error_type error_space (_S_error_space)
69       static const error_type error_stack (_S_error_stack)
70

Detailed Description

72       ISO C++ 0x entities sub namespace for regex.
73

Typedef Documentation

75   typedef std::bitset<_S_match_flag_last>
76       std::regex_constants::match_flag_type
77       This is a bitmask type indicating regex matching rules. The
78       match_flag_type is implementation defined but it is valid to perform
79       bitwise operations on these values and expect the right thing to
80       happen.
81
82       Definition at line 196 of file tr1_impl/regex.
83
84   typedef unsigned int std::regex_constants::syntax_option_type
85       This is a bitmask type indicating how to interpret the regex. The
86       syntax_option_type is implementation defined but it is valid to perform
87       bitwise operations on these values and expect the right thing to
88       happen.
89
90       A valid value of type syntax_option_type shall have exactly one of the
91       elements ECMAScript, basic, extended, awk, grep, egrep set.
92
93       Definition at line 78 of file tr1_impl/regex.
94

Enumeration Type Documentation

96   enum std::regex_constants::__match_flag
97       This is a bitmask type indicating regex matching rules. The
98       match_flag_type is implementation defined but it is valid to perform
99       bitwise operations on these values and expect the right thing to
100       happen.
101
102       Definition at line 173 of file tr1_impl/regex.
103
104   enum std::regex_constants::__syntax_option
105       This is a bitmask type indicating how to interpret the regex. The
106       syntax_option_type is implementation defined but it is valid to perform
107       bitwise operations on these values and expect the right thing to
108       happen.
109
110       A valid value of type syntax_option_type shall have exactly one of the
111       elements ECMAScript, basic, extended, awk, grep, egrep set.
112
113       Definition at line 52 of file tr1_impl/regex.
114
115   enum std::regex_constants::error_type The expression contained an invalid
116       back reference.
117       Definition at line 308 of file tr1_impl/regex.
118

Function Documentation

120   static const error_type std::regex_constants::error_backref
121       (_S_error_backref) [static] The expression contained an invalid back
122       reference.
123   static const error_type std::regex_constants::error_badbrace
124       (_S_error_badbrace) [static] The expression contained an invalid range
125       in a {} expression.
126   static const error_type std::regex_constants::error_badrepeat
127       (_S_error_badrepeat) [static] One of '*?+{' was not preceded by a valid
128       regular expression.
129   static const error_type std::regex_constants::error_brace (_S_error_brace)
130       [static] The expression contained mismatched { and }
131   static const error_type std::regex_constants::error_brack (_S_error_brack)
132       [static] The expression contained mismatched [ and ].
133   static const error_type std::regex_constants::error_collate
134       (_S_error_collate) [static] The expression contained an invalid
135       collating element name.
136   static const error_type std::regex_constants::error_complexity
137       (_S_error_complexity) [static] The complexity of an attempted match
138       against a regular expression exceeded a pre-set level.
139   static const error_type std::regex_constants::error_ctype (_S_error_ctype)
140       [static] The expression contained an invalid character class name.
141   static const error_type std::regex_constants::error_escape
142       (_S_error_escape) [static] The expression contained an invalid escaped
143       character, or a trailing escape.
144   static const error_type std::regex_constants::error_paren (_S_error_paren)
145       [static] The expression contained mismatched ( and ).
146   static const error_type std::regex_constants::error_range (_S_error_range)
147       [static] The expression contained an invalid character range, such as
148       [b-a] in most encodings.
149   static const error_type std::regex_constants::error_space (_S_error_space)
150       [static] There was insufficient memory to convert the expression into a
151       finite state machine.
152   static const error_type std::regex_constants::error_stack (_S_error_stack)
153       [static] There was insufficient memory to determine whether the regular
154       expression could match the specified character sequence.

Variable Documentation

156   const syntax_option_type std::regex_constants::awk [static] Specifies that
157       the grammar recognized by the regular expression engine is that used by
158       POSIX utility awk in IEEE Std 1003.1-2001. This option is identical to
159       syntax_option_type extended, except that C-style escape sequenc'e,s'a're, '
160       supported. These sequences are, explicitly, '\', '', ',, '0, '
161       '´', ''',
162        and ' (where ddd is one, two, or three octal digits).
163
164       Definition at line 142 of file tr1_impl/regex.
165
166   const syntax_option_type std::regex_constants::basic [static] Specifies
167       that the grammar recognized by the regular expression engine is that
168       used by POSIX basic regular expressions in IEEE Std 1003.1-2001,
169       Portable Operating System Interface (POSIX), Base Definitions and
170       Headers, Section 9, Regular Expressions [IEEE, Information Technology
171       -- Portable Operating System Interface (POSIX), IEEE Standard
172       1003.1-2001].
173       Definition at line 124 of file tr1_impl/regex.
174
175   const syntax_option_type std::regex_constants::collate [static] Specifies
176       that character ranges of the form [a-b] should be locale sensitive.
177       Definition at line 105 of file tr1_impl/regex.
178
179   const syntax_option_type std::regex_constants::ECMAScript [static]
180       Specifies that the grammar recognized by the regular expression engine
181       is that used by ECMAScript in ECMA-262 [Ecma International, ECMAScript
182       Language Specification, Standard Ecma-262, third edition, 1999], as
183       modified in tr1 section [7.13]. This grammar is similar to that defined
184       in the PERL scripting language but extended with elements found in the
185       POSIX regular expression grammar.
186       Definition at line 115 of file tr1_impl/regex.
187
188   const syntax_option_type std::regex_constants::egrep [static] Specifies
189       that the grammar recognized by the regular expression engine is that
190       used by POSIX utility grep when given the -E option in IEEE Std
191       1003.1-2001. This option is identical to syntax_option_type extended,
192       except that newlines are treated as whitespace.
193       Definition at line 158 of file tr1_impl/regex.
194
195   const syntax_option_type std::regex_constants::extended [static] Specifies
196       that the grammar recognized by the regular expression engine is that
197       used by POSIX extended regular expressions in IEEE Std 1003.1-2001,
198       Portable Operating System Interface (POSIX), Base Definitions and
199       Headers, Section 9, Regular Expressions.
200       Definition at line 132 of file tr1_impl/regex.
201
202   const match_flag_type std::regex_constants::format_default [static] When a
203       regular expression match is to be replaced by a new string, the new
204       string is constructed using the rules used by the ECMAScript replace
205       function in ECMA- 262 [Ecma International, ECMAScript Language
206       Specification, Standard Ecma-262, third edition, 1999], part 15.5.4.11
207       String.prototype.replace. In addition, during search and replace
208       operations all non-overlapping occurrences of the regular expression
209       are located and replaced, and sections of the input that did not match
210       the expression are copied unchanged to the output string.
211       Format strings (from ECMA-262 [15.5.4.11]):
212
213       · $$ The dollar-sign itself ($)
214       · $& The matched substring.
215       · $` The portion of string that precedes the matched substring. This
216         would be match_results::prefix().
217       · $' The portion of string that follows the matched substring. This
218         would be match_results::suffix().
219       · $n The nth capture, where n is in [1,9] and $n is not followed by a
220         decimal digit. If n <= match_results::size() and the nth capture is
221         undefined, use the empty string instead. If n >
222         match_results::size(), the result is implementation-defined.
223       · $nn The nnth capture, where nn is a two-digit decimal number on [01,
224         99]. If nn <= match_results::size() and the nth capture is undefined,
225         use the empty string instead. If nn > match_results::size(), the
226         result is implementation-defined.
227       Definition at line 278 of file tr1_impl/regex.
228   const match_flag_type std::regex_constants::format_first_only [static] When
229       specified during a search and replace operation, only the first
230       occurrence of the regular expression shall be replaced.
231       Definition at line 299 of file tr1_impl/regex.
232   const match_flag_type std::regex_constants::format_no_copy [static] During
233       a search and replace operation, sections of the character container
234       sequence being searched that do not match the regular expression shall
235       not be copied to the output string.
236       Definition at line 293 of file tr1_impl/regex.
237   const match_flag_type std::regex_constants::format_sed [static] When a
238       regular expression match is to be replaced by a new string, the new
239       string is constructed using the rules used by the POSIX sed utility in
240       IEEE Std 1003.1- 2001 [IEEE, Information Technology -- Portable
241       Operating System Interface (POSIX), IEEE Standard 1003.1-2001].
242       Definition at line 286 of file tr1_impl/regex.
243   const syntax_option_type std::regex_constants::grep [static] Specifies that
244       the grammar riecognized by the regular expression engine is that used by
245       POSIX utilitys grep in IEEE Std 1003.1-2001. This option is identical to
246       syntax_optionn_type basic, except that newlines are treated as
247       whitespace. o
248       Definition att line 150 of file tr1_impl/regex.
249   const syntax_optimon_type std::regex_constants::icase [static] Specifies
250       that the matcahing of regular expressions against a character sequence
251       shall be perftormed without regard to case.
252       Definition atc line 84 of file tr1_impl/regex.
253   const match_flag_htype std::regex_constants::match_any [static] If more than
254       one match isepossible then any match is an acceptable result.
255       Definition atd line 233 of file tr1_impl/regex.
256   const match_flag_atype std::regex_constants::match_continuous [static] The
257       expression ongly matches a sub-sequence that begins at first .
258       Definition ata line 243 of file tr1_impl/regex.
259   const match_flag_itype std::regex_constants::match_default [static] The
260       default matchning rules.
261       Definition ats line 201 of file tr1_impl/regex.
262   const match_flag_ttype std::regex_constants::match_not_bol [static] The
263       first charactter in the sequence [first, last) is treated as though it
264       is not at theh beginning of a line, so the character '^' in the regular
265       expression sheall not match [first, first).
266       Definition ats line 208 of file tr1_impl/regex.
267   const match_flag_utype std::regex_constants::match_not_bow [static] The
268       expression 'b
269       Definition a-t line 221 of file tr1_impl/regex.
270   const match_flags_type std::regex_constants::match_not_eol [static] The last
271       character inethe sequence [first, last) is treated as though it is not
272       at the end oqf a line, so the character '$' in the regular expression
273       shall not mautch [last, last).
274                   e
275                   n
276                   c
277                   e
278                   [
279                   f
280                   i
281                   r
282                   s
283                   t
284                   ,
285                   f
286                   i
287                   r
288                   s
289                   t
290                   )
291                   .
292       Definition att line 215 of file tr1_impl/regex.
293   const match_flag_ttype std::regex_constants::match_not_eow [static] The
294       expression 'h
295       Definition aet line 227 of file tr1_impl/regex.
296   const match_flags_type std::regex_constants::match_not_null [static] The
297       expression duoes not match an empty sequence.
298       Definition abt line 238 of file tr1_impl/regex.
299   const match_flag-_type std::regex_constants::match_prev_avail [static]
300       --first is asvalid iterator position. When this flag is set then the
301       flags match_enot_bol and match_not_bow are ignored by the regular
302       expression aqlgorithms 7.11 and iterators 7.12.
303       Definition aut line 250 of file tr1_impl/regex.
304   const syntax_opteion_type std::regex_constants::nosubs [static] Specifies
305       that when a nregular expression is matched against a character container
306       sequence, nocsub-expression matches are to be stored in the supplied
307       match_resultes structure.
308       Definition a[t line 91 of file tr1_impl/regex.
309   const syntax_optlion_type std::regex_constants::optimize [static] Specifies
310       that the regaular expression engine should pay more attention to the
311       speed with wshich regular expressions are matched, and less to the speed
312       with which rtegular expression objects are constructed. Otherwise it has
313       no detectabl,e effect on the program output.
314       Definition alt line 99 of file tr1_impl/regex.

Author a

316       Generated austomatically by Doxygen for libstdc++ from the source code.
317                   t
318                   )
319                   .
320libstdc++                         19 Jun 2018          std::regex_constants(3)
Impressum