Insert a Regex Token to Change a Matching Mode

The Insert Token button on the Create panel makes it easy to insert the following regular expression tokens to change how the regular expression engine applies your regular expression. These tokens are called mode modifiers.

Insert Mode Modifier

Mode modifiers are useful in situations where you can’t set overall matching modes like you can with the combo boxes on RegexBuddy’s toolbar. Mode modifiers are not supported by all applications that support matching modes. But in applications that do, mode modifiers always override modes set outside of the regex (combo boxes in RegexBuddy).

A mode modifier can change multiple options at the same time. The Mode Modifiers item in the Insert Token menu pops up a dialog box that shows all available options.

First, you need to choose whether the options you want to set should affect the whole regular expression, only the remainder of the regular expression, or only the contents of a group. Some of these choices may not be available, depending on your application’s regex flavor. A mode modifier for the whole regex can either include only those options that are changed from those set outside of the regex, or it can include all options to make the regex independent of the options set outside the regex.

The dialog box always shows all options that can be toggled via mode modifiers by some of the flavors that RegexBuddy supports. Those not supported by your application’s regex flavor are grayed out. Options that can be set outside the regex but for which no flavor has mode modifiers are not shown.

The checkboxes always positive labels to indicate the options they activate. To make the regex case sensitive, for example, you always tick the “case sensitive” checkbox, regardless of whether your regex flavor uses (?c) to turn on case sensitivity, or (?-i) to turn off case insensitivity. This avoids confusion when switching between regex flavors that have opposite options and avoids double negations such as “case insensitive off”.

Options that are already active, because they’re set by a preceding mode modifier or by options external to the regex, or simply because they’re the default options, are indicated by checkboxes in an “indeterminate” state. These checkboxes have either a square or a dash inside of them, depending on the theme or your version of Windows. Clicking on those options has no effect. RegexBuddy doesn’t let you add redundant mode modifiers. To turn off an option you need to turn on the opposite option.

Options that are not active have clear checkboxes. You can set those by clicking the checkbox. Click it again if you change your mind.

These options are available: