find

rule

Syntax
find pattern condition?
   local-declarations*
   action*


Purpose

A rule that defines a pattern to be matched in a source that is being scanned as a result of a submit statement.

When a pattern occurs in the current input which matches the pattern specified for the find rule, the rule is fired, causing the events associated with the rule to be executed.

When there is more than one find rule that can be selected, OmniMark will choose the one that appears earliest in the program.

When a find rule is selected, the input matched by the pattern is consumed and cannot be matched again. (OmniMark provides the lookahead operator to allow patterns to match without consuming the input.) Input matched by the pattern can be captured in pattern variables for later use in the actions associated with the rule.

A find rule must match at least one character, or one position in the input.

Any input that does not cause a find rule to fire is copied unchanged to the current output.