|  |  | 
| 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 | 
| flag | effects | notes | 
|---|---|---|
| match_default | Default | Default matching behavior. This constant has a value of zero**. | 
| 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). This constant has a value of zero**. | 
| 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. | 
| flag | error | 
|---|---|
| error_collate | The expression contained an invalid collating element name. | 
| error_ctype | The expression contained an invalid character class name. | 
| error_escape | The expression contained an invalid escaped character, or a trailing escape. | 
| error_backref | The expression contained an invalid back reference. | 
| error_brack | The expression contained mismatched brackets ([ and ]). | 
| error_paren | The expression contained mismatched parentheses (( and )). | 
| error_brace | The expression contained mismatched braces ({ and }). | 
| error_badbrace | The expression contained an invalid range between braces ({ and }). | 
| error_range | The expression contained an invalid character range. | 
| error_space | There was insufficient memory to convert the expression info a finite state machine. | 
| error_badrepeat | The expression contained a repeat specifier (one of *?+{) that was not preceded by a valid regular expression. | 
| error_complexity | The complexity of an attempted match against a regular expression exceeded a pre-set level. | 
| error_stack | There was insufficient memory to determine whether the regular expression could match the specified character sequence. |