C++ Regex Library - regex_constants



Description

It is a regex constants.

The types of regex constants should be as shown below −

Bitmask type error_type

It is used in the regex_error to identify the kind of error that threw the exception.

flag effects on syntax notes
icase Case insensitive Regular expressions match without regard to case.
nosubs No sub-expressions The match_results structure will not contain sub-expression matches.
optimize Optimize matching Matching efficiency is preferred over efficiency constructing regex objects.
collate Locale sensitiveness Character ranges, like "[a-b]", are affected by locale.
ECMAScript ECMAScript grammar

The regular expression follows one of these grammars.

One (and only one) of these six grammar flags needs to be set for the bitmask to have a valid value.

basic Basic POSIX grammar
extended Extended POSIX grammar
awk Awk POSIX grammar
grep Grep POSIX grammar
egrep Egrep POSIX grammar

Bitmask type syntax_option_type

it is used in the construction or assignment of regex objects to specify the syntax used by the object.

C++11

flag effects on syntax notes
icase Case insensitive Regular expressions match without regard to case.
nosubs No sub-expressions The match_results structure will not contain sub-expression matches.
optimize Optimize matching Matching efficiency is preferred over efficiency constructing regex objects.
collate Locale sensitiveness Character ranges, like "[a-b]", are affected by locale.
ECMAScript ECMAScript grammar

The regular expression follows one of these grammars.

One (and only one) of these six grammar flags needs to be set for the bitmask to have a valid value.

basic Basic POSIX grammar
extended Extended POSIX grammar
awk Awk POSIX grammar
grep Grep POSIX grammar
egrep Egrep POSIX grammar

C++14

flag effects on syntax notes
icase Case insensitive Regular expressions match without regard to case.
nosubs No sub-expressions

Sub-expressions are not considered to be marked.

The match_results structure will not contain sub-expression matches.

optimize Optimize matching Matching efficiency is preferred over efficiency constructing regex objects.
collate Locale sensitiveness Character ranges, like "[a-b]", are affected by locale.
ECMAScript ECMAScript grammar

The regular expression follows one of these grammars.

At most one of these six grammar flags can be set for the bitmask to have a valid value. If none is set, ECMAScript is assumed.

basic Basic POSIX grammar
extended Extended POSIX grammar
awk Awk POSIX grammar
grep Grep POSIX grammar
egrep Egrep POSIX grammar

Bitmask type match_flag_type

It is used as a parameter to functions regex_match, regex_search and regex_replace and also as a parameter to the constructors of regex_iterator and regex_token_iterator.

flag effects notes
match_default Default Default matching behavior.**.
match_not_bol Not Beginning-Of-Line The first character is not considered a beginning of line ("^" does not match).
match_not_eol Not End-Of-Line The last character is not considered an end of line ("$" does not match).
match_not_bow Not Beginning-Of-Word The escape sequence "\b" does not match as a beginning-of-word.
match_not_eow Not End-Of-Word The escape sequence "\b" does not match as an end-of-word.
match_any Any match Any match is acceptable if more than one match is possible.
match_not_null Not null Empty sequences do not match.
match_continuous Continuous

The expression must match a sub-sequence that begins at the first character.

Sub-sequences must begin at the first character to match.

match_prev_avail Previous Available One or more characters exist before the first one. (match_not_bol and match_not_bow are ignored)
format_default Default formatting Uses the standard formatting rules to replace matches (those used by ECMAScript's replace method).**.
format_sed sed formatting Uses the same rules as the sed utility in POSIX to replace matches.
format_no_copy No copy The sections in the target sequence that do not match the regular expression are not copied when replacing matches.
format_first_only First only Only the first occurrence of a regular expression is replaced.
regex.htm
Advertisements