...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
One of the following must always be set for perl regular expressions:
Element |
Standardized |
Effect when set |
---|---|---|
ECMAScript |
Yes |
Specifies that the grammar recognized by the regular expression engine uses its normal semantics: that is the same as that given in the ECMA-262, ECMAScript Language Specification, Chapter 15 part 10, RegExp (Regular Expression) Objects (FWD.1). This is functionally identical to the Perl regular expression syntax.
Boost.Regex also recognizes all of the perl-compatible |
perl |
No |
As above. |
normal |
No |
As above. |
JavaScript |
No |
As above. |
JScript |
No |
As above. |
The following options may also be set when using perl-style regular expressions:
Element |
Standardized |
Effect when set |
---|---|---|
icase |
Yes |
Specifies that matching of regular expressions against a character container sequence shall be performed without regard to case. |
nosubs |
Yes |
Specifies that when a regular expression is matched against a
character container sequence, then no sub-expression matches
are to be stored in the supplied |
optimize |
Yes |
Specifies that the regular expression engine should pay more attention to the speed with which regular expressions are matched, and less to the speed with which regular expression objects are constructed. Otherwise it has no detectable effect on the program output. This currently has no effect for Boost.Regex. |
collate |
Yes |
Specifies that character ranges of the form |
newline_alt |
No |
Specifies that the \n character has the same effect as the alternation operator |. Allows newline separated lists to be used as a list of alternatives. |
no_except |
No |
Prevents |
no_mod_m |
No |
Normally Boost.Regex behaves as if the Perl m-modifier is on: so the assertions ^ and $ match after and before embedded newlines respectively, setting this flags is equivalent to prefixing the expression with (?-m). |
no_mod_s |
No |
Normally whether Boost.Regex will match "." against
a newline character is determined by the match flag |
mod_s |
No |
Normally whether Boost.Regex will match "." against
a newline character is determined by the match flag |
mod_x |
No |
Turns on the perl x-modifier: causes unescaped whitespace in the expression to be ignored. |
no_empty_expressions |
No |
When set then empty expressions/alternatives are prohibited. |
save_subexpression_location |
No |
When set then the locations of individual sub-expressions within
the original regular expression string can
be accessed via the |