Compare string using wildcard characters

Syntax

int matchw(string pattern [flags])

 

Parameters

string - string.

pattern - string with wildcard characters.

flags:

1 case insensitive.

 

Remarks

Returns 1 if string matches pattern, or 0 if not.

 

Wildcard characters:

? maches any single character. Note that in Unicode mode it can be more than 1 byte because non ASCII characters consist of several bytes.

* matches 0 or more characters.

?* matches 1 or more characters.

** matches *.

*? matches ?.

 

See also: findrx, StrCompare.

 

Example

str s="file.txt"
if(matchw(s "*.txt"))
	...