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

1 assert(Path().match("*"));
2 assert(Path("").match("*"));
3 assert(Path(".").match("*"));
4 assert(Path("/").match("*"));
5 assert(Path("/hello").match("*"));
6 assert(Path("/hello/world.exe").match("*"));
7 assert(Path("/hello/world.exe").match("*.exe"));
8 assert(!Path("/hello/world.exe").match("*.zip"));
9 assert(WindowsPath("/hello/world.EXE").match("*.exe"));
10 assert(!PosixPath("/hello/world.EXE").match("*.exe"));

Meta