
The following flags control various aspects of regular expression matching. The case insensitive option may be specified when defining the statement. All flags may be specified within the pattern itself using the (?flags-flags) sequence. Flags specified before the optional - are enabled. Flags specified after the optional - are disabled.
| Flag | Description |
|---|---|
| i | If set, matching will take place in a case-insensitive manner. |
| x | If set, allow use of white space and #comments within patterns |
| s | If set, a "." in a pattern will match a line terminator in the input text. By default, it will not. Note that a carriage-return / line-feed pair in text behave as a single line terminator, and will match a single "." in a RE pattern |
| m | Control the behavior of "^" and "$" in a pattern. By default these will only match at the start and end, respectively, of the input text. If this flag is set, "^" and "$" will also match at the start and end of each line within the input text. |
| w | Controls the behavior of \b in a pattern. If set, word boundaries are found according to the definitions of word found in Unicode UAX 29, Text Boundaries. By default, word boundaries are identified by means of a simple classification of characters as either “word” or “non-word”, which approximates traditional regular expression behavior. The results obtained with the two options can be quite different in runs of spaces and other non-word characters. |
Regular Expression Metacharacters