Glob Pattern Tester
Type one or more glob patterns, paste a list of file paths, and instantly see which files match, which are excluded and why. Handy for build configs, linters, test runners, CI path filters and .ignore files.
Last updated:
Tip: paste the output of git ls-files or find . -type f. "Pick folder" only reads file names; nothing is uploaded.
How each pattern was read
How to use the Glob Pattern Tester
- Enter your patterns in the Glob patterns box, one per line. Start a line with
!to exclude, or#for a comment. - Add file paths: paste a list (for example from
git ls-files), load a .txt file, or pick a folder to list its file names. - Read the results: green paths match, red ones do not, and each row says which pattern decided it.
- Adjust the options (dotfiles, ignore case, match base name) to mirror the tool you are configuring.
- Copy or download the matching paths, or check the pattern cards to see the regex each glob became.
Glob syntax cheat sheet
| Pattern | Meaning | Matches | Does not match |
|---|---|---|---|
* | Any characters within one path segment | *.md → README.md | docs/guide.md |
** | Zero or more folders (when it is a whole segment) | docs/**/*.md → docs/a.md, docs/x/y/b.md | notes/a.md |
? | Exactly one character (not a slash) | v?.txt → v1.txt | v10.txt |
[abc] / [a-z] | One character from the set or range | [A-C]*.png → Banner.png | logo.png |
[!abc] / [^abc] | One character not in the set | [!_]*.scss → main.scss | _vars.scss |
{a,b} | Either alternative (brace expansion) | *.{jpg,png} → a.jpg, b.png | c.gif |
{1..3} | Numeric or letter range | part{1..3}.zip → part2.zip | part4.zip |
@(a|b) | Exactly one of the alternatives | @(app|web).config → web.config | api.config |
+(a|b) / *(a|b) | One or more / zero or more repeats | +([0-9]).log → 2024.log | v1.log |
!(a|b) | Anything except the alternatives | !(index).js → main.js | index.js |
!pattern | Exclude paths that match (whole line) | !**/*.min.js drops app.min.js | |
\* | Escape a special character | what\?.txt → what?.txt | whatx.txt |
How glob matching works
A glob is split at every / and each piece is compared with the matching folder or file name. Wildcards such as *, ? and […] never cross a slash; only a segment that is exactly ** can span several folders, and it may also match no folder at all, so a/**/b matches a/b. Braces are expanded first, so one pattern with braces is really several patterns. Behind the scenes each glob becomes a regular expression anchored to the whole path, which you can see in the pattern cards above.
Names that start with a dot are protected: a wildcard at the start of a segment will not match them unless the pattern itself starts with a dot or dotfile matching is turned on. This is why **/* in most tools skips .git and .env.
Tips for writing reliable globs
- Quote globs on the command line (
"src/**/*.ts") so your shell does not expand them before the tool sees them. - Use forward slashes, even on Windows. Most glob libraries treat a backslash as an escape character.
- Do not start with
./in config files; many tools compare against paths without it. This tester strips a leading./from both sides. - Put exclusions last and keep them specific, for example
!**/node_modules/**rather than!node_modules, which only matches the folder name itself. - Check case sensitivity: Linux file systems are case sensitive, while Windows and macOS usually are not. Use Ignore case to preview both.
Frequently asked questions
What is the difference between * and ** in a glob?
A single * matches any characters inside one folder level but never crosses a slash, so src/*.js matches src/app.js but not src/lib/app.js. A ** that stands alone as a path segment (globstar) matches zero or more whole folders, so src/**/*.js matches both.
How do negative patterns with ! work here?
A path is a match when at least one normal pattern matches it and no ! pattern does. If you only enter ! patterns, every path starts as included and the ! patterns remove some, which is how micromatch treats a list of only negations. Each row shows the pattern that included or excluded it.
Why does *.js not match .eslintrc.js or files in hidden folders?
By convention *, ? and ** do not match a name that starts with a dot, so hidden files and folders such as .git or .cache are skipped. Write the dot explicitly (.*.js or **/.cache/**) or tick Match dotfiles, which works like the dot: true option of minimatch, micromatch and fast-glob.
Are brace patterns like {js,ts} and {1..5} supported?
Yes. Braces are expanded before matching, as in Bash: *.{js,ts} becomes *.js and *.ts, nested braces work, and ranges such as {1..5}, {01..12} (zero padded), {a..e} and {0..20..5} (with a step) are expanded too. The pattern card lists the expanded patterns.
Does this behave exactly like minimatch, micromatch or fast-glob?
It follows the common rules those libraries share: globstar, dotfile handling, brace expansion, character classes, extglobs and ! negation. Libraries differ in small edge cases, for example whether src/** also matches the folder src itself (it does here, as in micromatch and picomatch). Always confirm unusual patterns with the tool you are configuring.
Is this the same as .gitignore syntax?
Not quite. .gitignore patterns without a slash match at any depth, a trailing slash means directories only, and later lines override earlier ones. To approximate a gitignore line like *.log, tick Match base name or write **/*.log.
Are my file paths uploaded anywhere?
No. Matching runs entirely in your browser. When you pick a folder, only the file names are read to build the list; file contents are never opened or sent.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.