The like 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 like operator checks to see if the text on the left matches the wildcard pattern specified on the right. This operator is similar to the match operator but with different wildcard characters:_
and %
. These 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. Unlike the match operator, like is case sensitive so the pattern character must exactly match, including upper and lower case.
Here are some examples:
"Jim Johnson" like "J%Johnson" ☞ true
"Jim Johnson" like "j%johnson" ☞ false
"Jack Johnson" like "J%Johnson" ☞ true
"Bill Johnson" like "J%Johnson" ☞ false
"JJohnson" like "J%Johnson" ☞ true
"J346 Ujohnson" like "J%Johnson" ☞ false
"J@#opcohnson" like "J%Johnson" ☞ false
"92685" like "926__" ☞ true
"92685-1000" like "926__" ☞ false
"9268" like "926__" ☞ false
"(714) 555-1212" like "(___) ___-____" ☞ true
"714-555-1212" like "(___) ___-____" ☞ false
The like operator 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 regexmatchexact, which uses Regular Expressions instead of simple wildcards.
See Also
History
Version | Status | Notes |
10.0 | Updated | Carried over from Panorama 6.0, but also now allows numeric as well as text parameters. |