ItemLocateWild

Searches for an item in that list that fully matches a 'pattern'.

Syntax:

ItemLocateWild (pattern, list, delimiter, start)

Parameters:

(s) pattern: the pattern to search for. May contain wild cards.

(s) list: a string containing a list of items.

(s) delimiter: a character to act as a delimiter between items in the list.

(i) start: position of first item to search.

Returns:

(i) position in list of item, or 0 if no match found.

 

Searches 'list' for first item that fully matches 'pattern' and returns the position of the matching item or 0 if no item fully matches. The search starts with the item indicated by the 'start' parameter. When an item satisfies the pattern, checking of that item is halted. If the pattern is satisfied without consuming the entire item, it is not considered a match and checking continues with the next item.

In the wild-card pattern, "*" matches zero or more characters, and "?" matches any one character.

ItemLocateWild searches are case insensitive.

A single item null list ("") is not a valid list.

Example:

list = "apples pears oranges grapes"
index = ItemLocateWild("o*s", list, " ", 1)
Message("The item is located at index #", index)

See Also:

ItemCount, ItemCountCsv, ItemExtract, ItemExtractCsv, ItemInsert, ItemLocate, ItemRemove, ItemReplace, ItemSort, Lists Explained