Skip to content

Commit 4d20bbc

Browse files
authored
content: Correct and improve glob patterns documentation
1 parent 39d369d commit 4d20bbc

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

content/en/quick-reference/glob-patterns.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@ The table below details the supported glob pattern syntax and its matching behav
1111

1212
| Match type | Glob pattern | Test string | Match? |
1313
| :--- | :--- | :--- | :--- |
14-
| Simple wildcard | `*.github.com` | `api.github.com` | `true` |
15-
| Literal match (quoted) | `*.github.com` | `*.github.com` | `true` |
16-
| Dot delimiter (single level) | `api.*.com` | `api.github.com` | `true` |
17-
| Dot delimiter (fails on nested) | `api.*.com` | `api.gi.hub.com` | `false` |
18-
| Super wildcard (multi-level) | `api.**.com` | `api.gi.hub.com` | `true` |
19-
| Single character | `?at` | `cat` | `true` |
20-
| Single character | `?at` | `fat` | `true` |
21-
| Single character (too short) | `?at` | `at` | `false` |
22-
| Delimiter exclusion | `?at` | `fat` | `false` |
23-
| Character list | `[abc]at` | `cat` | `true` |
24-
| Character list | `[abc]at` | `bat` | `true` |
25-
| Negated list | `[!abc]at` | `fat` | `true` |
26-
| Character range | `[a-c]at` | `cat` | `true` |
27-
| Character range | `[a-c]at` | `bat` | `true` |
28-
| Negated range | `[!a-c]at` | `fat` | `true` |
29-
| Pattern alternates | `{cat,bat,[fr]at}` | `rat` | `true` |
30-
| No match | `{cat,bat,[fr]at}` | `zat` | `false` |
14+
| Simple wildcard | `a/*.md` | `a/page.md` | true |
15+
| Literal match | `'a/*.md'` | `a/*.md` | true |
16+
| Single-level wildcard | `a/*/page.md` | `a/b/page.md` | true |
17+
| Single-level wildcard | `a/*/page.md` | `a/b/c/page.md` | false |
18+
| Multi-level wildcard | `a/**/page.md` | `a/b/c/page.md` | true |
19+
| Single character | `file.???` | `file.txt` | true |
20+
| Single character | `file.???` | `file.js` | false |
21+
| Delimiter exclusion | `?at` | `f/at` | false |
22+
| Character list | `f.[jt]xt` | `f.txt` | true |
23+
| Negated list | `f.[!j]xt` | `f.txt` | true |
24+
| Character range | `f.[a-c].txt` | `f.b.txt` | true |
25+
| Character range | `f.[a-c].txt` | `f.z.txt` | false |
26+
| Negated range | `f.[!a-c].txt` | `f.z.txt` | true |
27+
| Pattern alternates | `*.{jpg,png}` | `logo.png` | true |
28+
| No match | `*.{jpg,png}` | `logo.webp` | false |
3129

3230
The matching logic follows these rules:
3331

34-
- Standard wildcard (`*`) matches any character except for a path separator.
35-
- Super wildcard (`**`) matches any character including path separators.
36-
- Single character (`?`) matches exactly one character.
37-
- Negation (`!`) excludes specific characters or ranges when used inside brackets.
32+
- Standard wildcard (`*`) matches any character except for a delimiter.
33+
- Super wildcard (`**`) matches any character including delimiters.
34+
- Single character (`?`) matches exactly one character, excluding delimiters.
35+
- Negation (`!`) matches any character except those specified in a list or range when used inside brackets.
3836
- Character ranges (`[a-z]`) match any single character within the specified range.
37+
38+
The delimiter is a slash (`/`), except when matching semantic version strings, where the delimiter is a dot (`.`).

0 commit comments

Comments
 (0)