Namespaces
Variants
Views
Actions

cpp/regex/match flag type

From cppreference.com
< cpp‎ | regex
Revision as of 05:27, 22 July 2011 by P12 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
match_flag_type

namespace std {

 namespace regex_constants {
   enum syntax_option_type {
     match_default = 0,
     match_not_bol = (unspecified),
     match_not_eol = (unspecified),
     match_not_bow = (unspecified),
     match_not_eow = (unspecified),
     match_any = (unspecified),
     match_not_null = (unspecified),
     match_continuous = (unspecified),
     match_prev_avail = (unspecified),
     format_default = 0,
     format_sed = (unspecified),
     format_no_copy = (unspecified),
     format_first_only = (unspecified),
   };
   
   constexpr match_flag_type operator~(match_flag_type f);
   constexpr match_flag_type operator&(match_flag_type lhs, match_flag_type rhs);
   constexpr match_flag_type operator|(match_flag_type lhs, match_flag_type rhs);        
 }

}

The match_flag_type provides ways to modify how regular expression matching should be performed on a character sequence [first, last).

Constants

^ Value ^ Effect(s) if set ^ |match_not_bol|the first character in [first,last) will be treated as if it is **not** at the beginning of a line (i.e. ^ will not match [first,first)| |match_not_eol|the last character in [first,last) will be treated as if it is **not** at the end of a line (i.e. $ will not match [last,last)| |match_not_bow|"\b" will not match [first,first)| |match_not_eow|"\b" will not match [last,last)| |match_any|if more than one match is possible, then any match is an acceptable result| |match_not_null|do not match empty sequences| |match_continuous|only match a sub-sequence that begins at first| |match_prev_avail|--first is a valid iterator position. When set, causes match_not_bol and match_not_bow to be ignored| |format_default|use ECMAScript rules to construct strings when performing string replacement| |format_sed|use POSIX sed utility rules when performing string replacement| |format_no_copy|do not copy un-matched strings to the output during search and replace| |format_first_only|only replace the first match during search and replace|

Operators

Bitwise operators ~, &, and | are also defined for match_flag_type.