User Guide > Scripting > Script Operators > Recognition Rule Operators
Was this helpful?
Recognition Rule Operators
When defining a recognition rule, you need to select an operator for an implied expression that begins with the discriminator field.
See Also
Any Value Operator
This operator type acts like an Else statement. In other words, if the rule compares all the discriminators and the record does not match any of them, it matches the Any Value operator. Use this operator as the last rule to catch values that do not match any other records. If you do not have this kind of default, the first record defined is used.
Between Operator
The Between operator matches records that are between the low value and high value set when defining a recognition rule. The match is true if the value is greater than the low value, and less than the high value.
Like Operator
The Like operator in the record recognition rules is the SQL Like operator (with the addition of '#').
% - matches any string of zero or more characters
_ - matches any single character
# - matches any single digit (this is an extension to the SQL Like operator)
This operator cannot be included in any of the other more specific categories, but it is very useful and deserves documentation.
The Like operator is especially useful when you are attempting to write Record Expressions. For example, assume you have a ("State") field in your source file that is a 5 byte field and contains the "official" two digit abbreviations for states in the United States. You only want to convert those records for the state of Montana (abbreviated MT). Since the ("State") field actually contains two letters and three spaces, you should use the Like operator (instead of the = operator) so a map looks for the letters "MT" anywhere within those 5 bytes of the field. In the Record Expressions area of the Filter Windows, the expression would be written as follows:
FieldAt("/SOURCE/R1/State") Like "MT"
With the Like operator, there are a few special characters that you can use to look for a pattern rather than a literal string. They have different meanings from the same characters in other contexts:
? - indicates any one single character (like "." in other contexts)
* - indicates 0 or more characters (like ".*" in other contexts)
# - indicates a digit (like "[0-9]" in other contexts).
[ and ] - character classes are interpreted the same as in other contexts
With the Like operator, the entire string excluding leading and trailing spaces must match the regular expression.
See Also
Regular Expression Operator
A regular expression operator is a string of characters that defines a set of rules for matching character strings found in fields.
Last modified date: 12/03/2024