StrIndexWild

Finds wildcarded text within a larger string, ignoring case.

Syntax:

StrIndexWild(string, pattern, start)

Parameters:

(s) string the string to be searched for a sub-string.

(s) pattern the wildcarded text to search for.

(i) start the position in the main string to begin search. The first character of a string is position 1.

Returns:

(i/s) position of sub-string within string, or 0 if not found

 

This function searches for a sub-string within a "target" string. Starting at the start position. It stops when it finds the sub-string matching the pattern specified within the "target" string and returns its position.

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

If the pattern is a blank (NULL) string, and the specified start position is ZERO, this function returns the start position of the string.

If both the string and the pattern are blank (NULL) strings, this function returns zero.

The StrIndexWild search is case insensitive.

Example:


StrIndexWild("abcd1234wxyz", "ab*wx", 1) ; would return 1
StrIndexWild("abcd1234wxyz", "1*9", 1) ; would return 0 (no match)
StrIndexWild("abcd1234wxyz", "1*4", 1) ; would return 5
StrIndexWild("abcd1234wxyz", "1?34*z", 1) ; would return 5
See Also:

StrInsert, StrLen, StrScan, StrSub, StrIndex, StrIndexNc, StrOverlay