TEXT
match
PATTERN

The match operator checks to see if the text on the left matches the wildcard pattern specified on the right.


Parameters

This operator has two parameters:

text – The text you want to match.

pattern – The regular expression.


Description

The match operator checks to see if the text on the left matches the wildcard pattern specified on the right. This operator is similar to the contains operator except that the ? and * characters have special meanings:

The ? character will match any single character.

The * character will match any number of characters, or no characters.

Any other characters in the pattern must match a character in the text on the left. For example if the pattern contains an x, the text on the left must contain an x in the same spot (actually either lower case x or upper case X is fine, since the match operator is not case sensitive. If you want a case sensitive version of this operator use the matchexact operator.

Here are some examples:

"Jim Johnson" match "j*johnson" ☞ true
"Jack Johnson" match "j*johnson" ☞ true
"Bill Johnson" match "j*johnson" ☞ false
"JJohnson" match "j*johnson" ☞ true
"J346 Ujohnson" match "j*johnson" ☞ true
"J@#opcjohnson" match "j*johnson" ☞ true
"92685" match "926??" ☞ true
"92685-1000" match "926??" ☞ false
"9268" match "926??" ☞ false
"(714) 555-1212" match "(???) ???-????" ☞ true
"714-555-1212" match "(???) ???-????" ☞ false

You can use the match operator as an alternative to the contains, beginswith or endswith operators:

A contains B is the same as A match "*"+B+"*"

A beginswith B is the same as A match B+"*"

A endswith B is the same as A match "*"+B

The match function only has two special characters, making it easy to use but rather limited. For a much more powerful (and much more complicated) pattern matching operator see regexmatch, which uses Regular Expressions instead of simple wildcards.


See Also


History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0, but also now allows numeric as well as text parameters.