WildCharMatch()

WildCharMatch(value,WildChars) is a simple function that compares two strings (value and WildChars) in which the WildChars parameter can contain wildcards and then returns all matching strings. In the syntax a "?" (question mark) represents a single alphanumeric character and an "*" (asterisk) represents a string.

WildCharMatch() retrieves alphanumeric data only. If you need to ensure that the data you retrieve is decimal only, use match().

WildCharMatch() examples

Following are some WildCharMatch() usage examples:

WildCharMatch(form.company,’12?4’)

Retrieves all companies that start with “12,” end with “4,” and are four characters in length. (Uses one wildcard.)

WildCharMatch(form.company,’1??4’)

Retrieves all companies that start with “1,” end with “4,” and are four characters in length. (Uses two wildcards.)

WildCharMatch(form.company,’1*4’)

Retrieves all companies that start with “1,” end with “4,” and are of any length.

WildCharMatch(user.getAttribute(‘role’),’Man*’)

Retrieves all roles (alphanumeric strings of any length) that start with “Man”.