match

Whether the given path matches the given glob-style pattern

match
(
PathType
Pattern
)
(
auto ref in PathType p
,
Pattern pattern
)
if (
isSomePath!PathType
)

Examples

assert(Path().match("*"));
assert(Path("").match("*"));
assert(Path(".").match("*"));
assert(Path("/").match("*"));
assert(Path("/hello").match("*"));
assert(Path("/hello/world.exe").match("*"));
assert(Path("/hello/world.exe").match("*.exe"));
assert(!Path("/hello/world.exe").match("*.zip"));
assert(WindowsPath("/hello/world.EXE").match("*.exe"));
assert(!PosixPath("/hello/world.EXE").match("*.exe"));

Meta