All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2s
36 lines
1.2 KiB
Markdown
36 lines
1.2 KiB
Markdown
# kpmatch - Path patterns
|
|
|
|
## Features and limitations
|
|
|
|
* **Bash-style pathname patterns**
|
|
* **Curly braces syntax:** `a{/b/c,bc}` expands into `a/b/c` and `abc`
|
|
* **Pattern specificity ranking:** patterns can be sorted to test
|
|
a path against the more specific patterns first
|
|
* **Pure paths:** This library does not access the filesystem. It does
|
|
not check if a path exists and does not differentiate between files
|
|
and directories.
|
|
* Ranges `[0-9]`, character classes `[:space:]` are
|
|
not supported.
|
|
* The extended operators `?(...)`, `*(...)`, `+(...)`, `@(...)`
|
|
and `!(...)` are not supported.
|
|
|
|
## Pattern Syntax
|
|
|
|
Braced sections `{ , }` are expanded.
|
|
|
|
Path patterns should always use forward slashes `/` between segments.
|
|
The actual separator used when matching paths depends on the system.
|
|
|
|
A path segment containing two asterisks `/**/` matches zero, one or more
|
|
segments.
|
|
|
|
A single asterisk `*` matches zero, one or more characters except a path
|
|
separator.
|
|
|
|
A question mark `?` matches exactly one character unless it's a path
|
|
separator.
|
|
|
|
Square brackets `[ ]` can match one of the characters between the brackets.
|
|
If the first character is an exclamation point `[! ]`, it will match one
|
|
character that does NOT appear between the brackets.
|