# Okapi Framework - Filters ## Regex Filter - Edit Rule Dialog

If you are using an Okapi Tool after the M9 release, you should be using the wiki online help:
http://www.opentag.com/okapi/wiki/index.php?title=Regex_Filter

This dialog box allows you to edit a rule of the Regex Filter.

#### Regular expression

Enter the regular expression for this rule. The expression must be a valid Java regular expression. The capturing groups you define inside this expression are used to specify what parts is what in the generated events.

Example -- Enter a example of text to process. The result of the rule applied to the example is shown below the example, as you modify the parameters. All matches for the given rule are provided.

Example of expressions:

    Expression: ^(.*?)=\[(.*?)]\Z

        Sample: ID001=[Source text]

### Action and Groups

Action -- Select the action to perform for this rule. Which fields can be used depends on the action selected. There are the following choices:

- Extract the strings in the source group: Extracts each strings within the source capturing group defined for this rule. The content into a separate text unit. The beginning and ending of the strings are defined in the Options tab.
- Extract the content of the source group: Extracts the content into a single text unit, according the different capturing groups defined for the rule.
- Treat the source group content as comment: Does not extract anything, but process the content as a comment and search for localization directives if that option is set.
- Do not extract: Leaves the content alone.
- Start a section: Sends a `START_GROUP` event.
- End a section: Sends an `END_GROUP` event.

See the Actions section for more detailed information on how actions work.

Source group number -- Enter the number of the capturing corresponding to the source content for this rule. If this field is enabled, you must provide a value.

Target group number -- Enter the number of the capturing corresponding to the target content for this rule. Use -1 to leave this group undefined.

Identifier group number -- Enter the number of the capturing corresponding to the identifier content for this rule. Use -1 to leave this group undefined.

Note group number -- Enter the number of the capturing corresponding to the note content for this rule. Use -1 to leave this group undefined.

Note that capturing groups are numbered by counting their opening parentheses from left to right. For example, in the expression `((A)(B(C)))` there are four groups:

1. `((A)(B(C)))`
2. `(A)`
3. `(B(C))`
4. `(C)`