true if pattern matches filename, false otherwise.
Nothing.
patternMatch("Go*.bar", "[fg]???bar"); // => false patternMatch("/foo*home/bar", "?foo*bar"); // => true patternMatch("foobar", "foo?bar"); // => true
test(!patternMatch("foo", "Foo")); test(patternMatch("foo", "*")); test(patternMatch("foo.bar", "*")); test(patternMatch("foo.bar", "*.*")); test(patternMatch("foo.bar", "foo*")); test(patternMatch("foo.bar", "f*bar")); test(patternMatch("foo.bar", "f*b*r")); test(patternMatch("foo.bar", "f???bar")); test(patternMatch("foo.bar", "[fg]???bar")); test(patternMatch("foo.bar", "[!gh]*bar")); test(!patternMatch("foo", "bar")); test(!patternMatch("foo", "*.*")); test(!patternMatch("foo.bar", "f*baz")); test(!patternMatch("foo.bar", "f*b*x")); test(!patternMatch("foo.bar", "[gh]???bar")); test(!patternMatch("foo.bar", "[!fg]*bar")); test(!patternMatch("foo.bar", "[fg]???baz"));
Matches a pattern against a filename.
Some characters of pattern have special a meaning (they are meta-characters) and can't be escaped. These are:
Internally individual character comparisons are done calling charMatch(), so its rules apply here too. Note that path separators and dots don't stop a meta-character from matching further portions of the filename.