RegExpr flags

The RegExpr function has an optional Flags parameter. The possible values for Flags are:

FlagDescription
reCaseSensitiveMatches are case sensitive. X and x are different. This is the default.
reCaseInSensitiveMatches are not case sensitive. X and x are the same.
Single vs. multiline:
(default)The default setting without flags:
"." doesn't match a newline, "^" matches only at beginning of string, "$" matches only at end of string.
reSingleLineTreat the input as a single line:
"." matches a newline.
reMultilineTreat the input as multiple lines:
"^" matches at beginning of string or line, "$" matches at end of string or line.
reSingleLine + reMultilineCombination:
"." matches a newline, "^" matches at beginning of string or line, "$" matches at end of string or line.

Single vs. multiline flags summarized:

Flag. matches^ matches$ matches
(default)all except newlinebeginning of stringend of string
reSingleLineallbeginning of stringend of string
reSingleLine + reMultilineallbeginning of string or lineend of string or line
reMultilineall except newlinebeginning of string or lineend of string or line

You can combine Flags with the plus (+) operator like this: reCaseInSensitive + reSingleLine.

©Aivosto Oy · RegExpr Help