true if the filename matches the pattern.
Example:
assert(filenameMatch("file.txt", "*.txt"));
assert(filenameMatch("file.txt", "file.*"));
assert(!filenameMatch("file.txt", "*.doc"));bool filenameMatch(string name, string pattern) @trustedMatches a filename against a pattern.
The pattern can contain the following wildcards:
[set] matches any character in the set[^set] matches any character not in the setname | Filename to test |
pattern | Pattern to match against |
true if the filename matches the pattern.
Example:
assert(filenameMatch("file.txt", "*.txt"));
assert(filenameMatch("file.txt", "file.*"));
assert(!filenameMatch("file.txt", "*.doc"));