Element | Effect(s) if set | |
icase | Specifies that matching of regular expressions against a character
container sequence shall be performed without regard to case. | |
nosubs | Specifies that no sub-expressions shall be considered to be marked, so that
when a regular expression is matched against a
character container sequence, no sub-expression matches shall be
stored in the supplied match_results object. | |
optimize | ||
collate | ||
ECMAScript | Specifies that the grammar recognized by the regular expression engine
shall be that used by ECMAScript in ECMA-262, as modified in [re.grammar]. | |
basic | Specifies that the grammar recognized by the regular expression engine
shall be that used by basic regular expressions in POSIX. See also: POSIX, Base Definitions and Headers, Section 9.3 | |
extended | Specifies that the grammar recognized by the regular expression engine
shall be that used by extended regular expressions in POSIX. See also: POSIX, Base Definitions and Headers, Section 9.4 | |
awk | Specifies that the grammar recognized by the regular expression engine
shall be that used by the utility awk in POSIX. | |
grep | Specifies that the grammar recognized by the regular expression engine
shall be that used by the utility grep in POSIX. | |
egrep | Specifies that the grammar recognized by the regular expression engine
shall be that used by the utility grep when given the -E
option in POSIX. | |
multiline | Specifies that ^ shall match the beginning of a line and
$ shall match the end of a line,
if the ECMAScript engine is selected. |
Element | Effect(s) if set | |
The first character in the sequence [first, last) shall be treated
as though it is not at the beginning of a line, so the character
^ in the regular expression shall not match [first, first). | ||
The last character in the sequence [first, last) shall be treated
as though it is not at the end of a line, so the character
"$" in the regular expression shall not match [last, last). | ||
If more than one match is possible then any match is an
acceptable result. | ||
The expression shall not match an empty
sequence. | ||
The expression shall only match a sub-sequence that begins at
first. | ||
When a regular expression match is to be replaced by a
new string, the new string shall be constructed using the rules used by
the ECMAScript replace function in ECMA-262,
part 15.5.4.11 String.prototype.replace. In
addition, during search and replace operations all non-overlapping
occurrences of the regular expression shall be located and replaced, and
sections of the input that did not match the expression shall be copied
unchanged to the output string. | ||
When a regular expression match is to be replaced by a
new string, the new string shall be constructed using the rules used by
the sed utility in POSIX. | ||
During a search and replace operation, sections of
the character container sequence being searched that do not match the
regular expression shall not be copied to the output string. | ||
When specified during a search and replace operation, only the
first occurrence of the regular expression shall be replaced. |
Value | Error condition | |
error_collate | The expression contains an invalid collating element name. | |
error_ctype | The expression contains an invalid character class name. | |
error_escape | The expression contains an invalid escaped character, or a trailing
escape. | |
error_backref | The expression contains an invalid back reference. | |
error_brack | ||
error_paren | ||
error_brace | The expression contains mismatched { and } | |
error_badbrace | The expression contains an invalid range in a {} expression. | |
error_range | The expression contains an invalid character range, such as
[b-a] in most encodings. | |
error_space | There is insufficient memory to convert the expression into a finite
state machine. | |
error_badrepeat | One of *?+{ is not preceded by a valid regular expression. | |
error_complexity | The complexity of an attempted match against a regular expression
exceeds a pre-set level. | |
error_stack | There is insufficient memory to determine whether the regular
expression matches the specified character sequence. |