StrSubWild

Extracts a substring matching wildcarded text from within a larger string.

Syntax:

StrSubWild ( string, pattern, start)

Parameters:

(s) string the string to look in.

(s) pattern the wildcarded text to match.

(i) start the position (in characters) within the string to begin matching. StrIndexWild can be used to locate the start position.

Returns:

(s) The portion of the string matched by the wildcard pattern.

 

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

It is important to remember that matching begins at the string position indicated by the start parameter. This means that the character at the start position must match the first character of the pattern. This is why it is important to use StrIndexWild to get the start position when the first matching character is not at the beginning of the string.

Example:


StrSubWild("abcd1234wxyz", "ab*wx", 1) ; would return "abcd1234wx"
StrSubWild("abcd1234wxyz", "1*9", 1) ; would return ""
StrSubWild("abcd1234wxyz", "1*4", 5) ; would return "1234"
StrSubWild("abcd1234wxyz", "1?34*z", 5) ; would return "1234wxyz"
See Also:

StrInsert, StrLen, StrOverlay, StrScan, StrSub, StrIndexWild