Rainbow - Code Finder Editor
This dialog box allows you to edit the rules for the code finder component that is used in several filter. Because not all filters have a graphical user interface to edit their options, this editor can be used to create and maintain the section of the filter's parameter file that stores the rules for the code finder.
Some of the filters using the code finder are:
Add — Click this button to add a new rule.
Remove — Click this button to remove the current rule.
Move Up — Click this button to move the current rule upward.
Move down — Click this button to move the current rule downward.
[Top-right text box] — Enter the regular expression for the current rule. Use the Modify button to enter the edit mode. The expression must be a valid regular expression. You can check the syntax (and the effect of the rule) as it automatically tests it against the test data in the text box below and shows the result in the bottom-right text box.
Modify — Click this button to edit the expression of the current rule. This button is labeled Accept when you are in edit mode.
Accept — Click this button to save any changes you have made to the expression and leave the edit mode. This button is labeled Modify when you are not in edit mode.
Discard — Click this button to leave the edit mode and revert the current rule to the expression it had before you started the edit mode.
Patterns — Click this button to display some help on regular expression patterns.
Test using all rules — Set this option to test all the rules at the same time. The syntax of the current rule is automatically checked. See the effect it has on the sample text. The result of the test are displayed in the bottom right result box. The parts of the text that are matches of the expressions are displayed in <> brackets. If the Test using all rules option is set, the test takes all rules of the set in account, if it is not set only the current rule is tested.
[Middle-right text box] — Optional test data to test the regular expression for the current rule or all rules depending on the Test using all rules option.
[Bottom-right text box] — Shows the result of the regular expression applied to the test data.
XML Aware — Set this option to make the copy and paste command XML aware. When this option is set the parameters are escaped to XML when copying to the Clipboard, and unescaped from XML when pasting from the Clipboard.
YAML Aware — Set this option to make the copy and paste command YAML aware. When this option is set the parameters are escaped to the YAML syntax when copying to the Clipboard, and unescaped from the YAML syntax when pasting from the Clipboard.
Paste From Clipboard — Click this button to paste from the Clipboard a string corresponding to the code finder rules. The content of the Clipboard must a valid string representation of the rules, for example copied from the configuration file of one of the filters that uses the code finder. If the string is not valid the rules are reset.
For example, in the following XML Filter configuration file, the part highlighted is one the to paste into the Code Finder Editor.
<its:rules version="1.0" xmlns:its="http://www.w3.org/2005/11/its" xmlns:okp="okapi-framework:xmlfilter-options"> <okp:codeFinder useCodeFinder="yes">#v1 count.i=2 rule0=<(/?)\w[^<]*?> rule1=(#\w+?\#)|(%\d+?%) </okp:codeFinder> </its:rules>
Copy To Clipboard — Click this button to copy to the Clipboard the string corresponding to the rules defined in the dialog. If the XML aware option is set the string is also escaped for XML. Once in the Clipboard the string can be pasted as-it into the configuration file of one of the filters that uses the code finder.