You can specify options that control how the regular expression engine interprets a regular expression pattern. Many of these options can be specified either inline (in the regular expression pattern) or as one or more RegexOptions constants. This quick reference lists only inline options.
Pattern | Description | Sample | Matches |
i | Use case-insensitive matching. | \b(?i)a(?-i)a\w+\b | "aardvark", "aaaAuto" in "aardvark AAAuto aaaAuto Adam breakfast" |
m | Use multiline mode. ^ and $ match the beginning and end of a line, instead of the beginning and end of a string. | - | - |
n | Do not capture unnamed groups. | - | - |
s | Use single-line mode. | - | - |
x | Ignore unescaped white space in the regular expression pattern. | \b(?x) \d+ \s \w+ | "1 aardvark", "2 cats" in "1 aardvark 2 cats IV centurions" |