Search for * in matches

nate100

Member
I have a string like the following" "98776*". How do I use matches to see if there is an * in a string.

val1 matches "*" is what I tried but not working

THanks
 
mrobles has posted an option. But if you want to use MATCHES then the following will work:

Code:
MESSAGE "97866*" MATCHES "*~~*"
  VIEW-AS ALERT-BOX INFO BUTTONS OK.
You have to double-escape the * according to help:

To specify either an asterisk ( * ), as a literal character rather than a wildcard character in the pattern, or a period ( . ) as a literal character, you must enter a tilde (~) before the character. However, if you specify the match pattern as a literal quoted string in a procedure file, you must enter each tilde as a double tilde ( ~ ~ ). The first tilde escapes the second tilde, so that the AVM interprets the second tilde as a tilde for the match pattern. For example, the result of “*a.b” MATCHES “~~*a~~.b” is TRUE.
 
Back
Top