wildcard_file

Definition: integer i = wildcard_file(string st1, string st2)
Description: Return 1 (true) if the filename st2 matches the wild card pattern st1. Return 0 (false) otherwise. This is similar to DOS wildcard matching, but better in some cases. * matches any 0 or more characters, ? matches any single character. Character comparisons are not case sensitive.
Comments: You might use this function to check the output of the dir() routine for file names that match a pattern supplied by the user of your program.

In DOS "*ABC.*" will match all files. wildcard_file("*ABC.*", s) will only match when the file name part has "ABC" at the end (as you would expect).
Example 1:
i = wildcard_file("AB*CD.?", "aB123cD.e")
-- i is set to 1
Example 2:
i = wildcard_file("AB*CD.?", "abcd.ex")
-- i is set to 0, because the file type has 2 letters not 1
Example Program: bin\search.ex
See Also: wildcard_match, dir