Application icon

Regular Expression Flag Options

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.


FlagDescription
iIf set, matching will take place in a case-insensitive manner.
xIf set, allow use of white space and #comments within patterns
sIf 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
mControl 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.
wControls 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

Regular Expression Operators

Regular Expression Replace Template Format