Okapi Framework - Steps

Search and Replace Step

- Overview
- Parameters

If you are using an Okapi Tool after the M9 release, you should be using the wiki online help:
http://okapiframework.org/wiki/index.php?title=Search_and_Replace_Step

Overview

This step performs search and replace actions on either the text units or the full content of input documents.

Takes: Raw document or Filter events
Sends: Raw document or Filter events

The step provides a way to define a list of search entries and corresponding replacement. You can use regular expressions if needed.

The step can take ither as input either a raw document, or filter events.

Parameters

The items list contains three columns:

To edit an item : Double-click the item, or click the Edit button. To check and un-check an item: Click the checkbox, or press Space when the item is selected.

Add -- Click this button to add a new item in the list.

Edit -- Click this button to edit the item currently selected.

Remove -- Click this button to remove the item currently selected from the list.

Move Up -- Click this button to move the item currently selected upward.

Move Down -- Click this button to move the item currently selected downward.

Import -- Click this button to import an existing file that contains saved options for this step.

Export -- Click this button to export to a file the current options for this step.

Use regular expressions -- Set this option to enable the Regular Expressions mode. Note that the placeholders to use in the replacement string for the search group are $1, $2, etc. ($1 corresponds to the part matching the first group of the search expression, etc.) See the documentation on Matcher.replaceAll() for more details. In addition, in the replacement field you can specify "\n", "\r", and "\t" for for line-feed, carriage-return, and tab; as well as "\N" to replace by the line-break type of the current platform, for example "\r\n" for Windows.

Regular expression options

When this option is checked several regular expression options are accessible. They apply to all expressions, not just the selected one:

Ignore case -- Set this option to ignore the cases in the matches. for example "bear" matches "Bearcat", "BEARCAT", and "bearcat".

Multiline -- Set this option to changes the meaning of ^ and $ so that they match at the beginning and end of any line, not just the beginning and end of the whole string.

Dot also matches line-feed -- Set this option to changes the meaning of the period character '.' so that it matches every character instead of every character except \n.