RegExpr Help › Flags
The RegExpr function has an optional Flags parameter. The possible values for Flags are:
Flag | Description |
---|---|
reCaseSensitive | Matches are case sensitive. X and x are different. This is the default. |
reCaseInSensitive | Matches 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. |
reSingleLine | Treat the input as a single line: "." matches a newline. |
reMultiline | Treat the input as multiple lines: "^" matches at beginning of string or line, "$" matches at end of string or line. |
reSingleLine + reMultiline | Combination: "." 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 newline | beginning of string | end of string |
reSingleLine | all | beginning of string | end of string |
reSingleLine + reMultiline | all | beginning of string or line | end of string or line |
reMultiline | all except newline | beginning of string or line | end of string or line |
You can combine Flags with the plus (+) operator like this: reCaseInSensitive + reSingleLine.
©Aivosto Oy · RegExpr Help