Glob Pattern Tester
Test a glob pattern against a list of file paths and see live which ones match.
One pattern per test. Prefix it with ! to invert the match.
4 of 7 paths match
- match
src/index.js - match
src/app.ts - match
src/utils/date.js - match
src/utils/date.test.js - no match
README.md - no match
dist/bundle.js - no match
.env
Inverted by the leading โ!โ: the matches are the paths this expression does not hit.
Glob syntax cheat sheet
*- any characters inside one path segment, never crossing
/ **- globstar: zero or more whole segments, so
a/**/bmatchesa/banda/x/y/b ?- exactly one character, except
/ [abc][a-z]- one character from the set or range
[!abc][^abc]- one character not in the set (and never
/) {js,ts}- brace alternation, expanded before matching
{1..5}{a..e}- brace ranges
!pattern- invert: keep the paths the pattern does not match
\*- a backslash makes the next character literal
.env- a leading dot is only matched by a wildcard when "matches dotfiles" is ticked
POSIX named classes such as [[:alpha:]] and extglob groups such as
@(a|b) are not supported.
How it works
Type a glob pattern and a list of paths: every line is re-tested as you type and marked
match or no match, with a count above the list. The matcher implements POSIX shell
pattern matching (IEEE Std 1003.1-2017, Shell and Utilities section 2.13, the rules
behind fnmatch()) plus the two extensions everyone actually uses: the
** globstar and {a,b} brace expansion from Bash, as
implemented by Node's minimatch and picomatch. That is the flavour you meet in npm
scripts, ESLint and Prettier ignore files, webpack, Vite, Rollup, tsconfig
include and exclude, and most CI path filters. Patterns are
anchored at both ends and matched against the whole path, so *.js matches
app.js but not src/app.js; use **/*.js for that.
Braces are expanded first into plain patterns, then each one is compiled to a JavaScript
regular expression, shown underneath so you can drop it into your own code or check what
the pattern really means. Backslashes in your test paths are turned into forward slashes
and a leading ./ is dropped, so Windows-style paths work too. Everything
runs 100% in your browser: the pattern and the paths you test are never uploaded, so a
file listing from a private repository is safe to paste here.
Frequently asked questions
How do I test a glob pattern against file paths?
Type your pattern in the top box and paste one path per line underneath. Every line is re-tested as you type and marked match or no match, with a count above the list. There is no button to press, and you can copy or download just the matching paths when you are done.
What is the difference between * and ** in a glob pattern?
A single star matches any characters inside one path segment and never crosses a slash, so *.js matches app.js but not src/app.js. The double-star globstar matches zero or more whole segments, so **/*.js matches both, and a/**/b matches a/b, a/x/b and a/x/y/b. A trailing ** such as src/** matches everything below src.
Which glob syntax does this tester support?
It implements POSIX shell pattern matching (IEEE Std 1003.1-2017, Shell and Utilities section 2.13, the rules behind fnmatch) plus the Bash extensions everyone uses: the ** globstar and brace expansion including ranges like {1..12}. That is the minimatch and picomatch flavour you get in npm scripts, ESLint and Prettier ignore files, webpack, Vite, Rollup and tsconfig include and exclude. POSIX named classes such as [[:alpha:]] and extglob groups such as @(a|b) are not supported, and the page says so.