Toolstia / Glob pattern tester
glob pattern tester
Type a glob pattern, paste a list of file paths, and see which paths match. It also shows the regular expression the glob turns into.
* matches any characters except a slash, ** matches across folders, ? matches one character, [abc] and [!abc] match or exclude characters, and {a,b} or {1..3} expand to alternatives. Matching is against the whole path, and a leading ./ is ignored. Hidden files starting with a dot are matched like any other file.
How it works
- Type the glob pattern.
- Paste the paths to test, one per line.
- Check which paths match and adjust the pattern.
Supported syntax
* matches anything except a slash, ** matches across folders, ? matches one character, [abc] and [!abc] match a set of characters, and braces such as {js,ts} or {1..3} expand into alternatives.
Whole path matching
The pattern has to match the full path, so *.js matches app.js but not src/app.js. Use **/*.js for any depth.
Where globs are used
Build tools, test runners, linters, .gitignore style files, GitHub Actions path filters and shell commands.
The regex view
Seeing the equivalent regular expression helps you understand why a path did or did not match.
Questions
Are my paths uploaded?
Everything happens in your browser, and nothing you enter is sent anywhere.
Does ** match zero folders?
Yes. **/*.js matches app.js and also a/b/app.js.
Are dotfiles treated differently?
No. Hidden files that start with a dot are matched like any other file.