Glob¶
Filename matching and globbing with shell patterns.
fnmatch(file_name, pattern) matches according to the local convention.
fnmatchcase(file_name, pattern) always takes case into account. The
functions operate by translating the pattern into a regular expression.
The function translate(PATTERN) returns a regular expression corresponding to PATTERN.
Patterns are Unix shell style: * | matches multiple characters within a directory ** | matches multiple characters across directories ? | matches any single character [seq] | matches any character in seq [!seq] | matches any char not in seq
Constructors¶
create¶
Returns¶
- Glob val^
Public Functions¶
fnmatch¶
Tests whether name matches pattern.
An initial period in name is not special.
Both name and pattern are first case-normalized if the operating system
requires it. If you don't want this, use fnmatchcase.
Parameters¶
Returns¶
- Bool val
fnmatchcase¶
Tests whether name matches pattern, including case.
Parameters¶
Returns¶
- Bool val
filter¶
Returns name and the matching subgroups for names that match pattern.
All strings are first case-normalized if the operating system requires it.
fun box filter(
names: Array[String val] ref,
pattern: String val)
: Array[(String val , Array[String val] ref)] val
Parameters¶
Returns¶
translate¶
Translates a shell pattern to a regular expression.
There is no way to quote meta-characters.
Parameters¶
- pat: String val
Returns¶
- String ref^
glob¶
Returns an Array[FilePath] for each path below root_path that matches
pattern.
The pattern may contain shell-style wildcards. See the type documentation
on Glob for details.
Parameters¶
Returns¶
iglob¶
Calls GlobHandler.apply for each path below root that matches
pattern.
The pattern may contain shell-style wildcards. See the type documentation
on Glob for details.
Parameters¶
- root: FilePath val
- pattern: String val
- glob_handler: GlobHandler ref
Returns¶
- None val
eq¶
Parameters¶
- that: Glob val
Returns¶
- Bool val
ne¶
Parameters¶
- that: Glob val
Returns¶
- Bool val