You are viewing documentation for Structure Server and Data Center version 5.6 and patch releases. For other versions, see Version Index or [Structure Cloud].
Expr language allows you to check text values against a certain pattern, when using the MATCH, CASE, REPLACE or SEARCH function.
There are three types of patterns that can used: Exact Matching, Wildcard Matching, and Regular Expression Matching.
This is the simplest pattern type, which compares value
against an exact text value:
MATCH(value, "Apples")
Although it's called "exact matching", there are some additional rules that make the matching easier:
APPLES
will match Apples
.Exact matching is used by default, unless the pattern is recognized as requiring Wildcard or Regular Expression matching.
Wildcard patterns let you use the wildcard symbol "*
" to specify any number of any characters (including no characters).
MATCH(value, "App*")
The above function would return "1" for any value that started with the characters "App" – so "App", "Apple" and "Apples are good for you" would all match. You can also use multiple asterisks to build your pattern. Match(value, "A*L*")
would match anything that starts with an A and contains an L, including "Apples", "Almanac" and "Aunt Sal".
Wildcard matching uses the same rules as exact matching:
APPLES
will match App*
.Wildcard matching is used when the pattern is not recognized to be a Regular Expression Pattern but contains at least one asterisk.
This type of matching lets you use powerful regular expressions to specify exactly what you need to match with.
MATCH(value, "/^Ap+.*s$/")
Structure uses regular expressions available with Java. For a full documentation about the regular expression language, see Java documentation for Pattern.
The regular expression matching is different from other types of matching. The following rules apply:
Regular expression matching is turned on if the first and the last characters of the pattern are "/
". (These characters are removed, as they are not a part of the pattern.)