Developer Tools
Glob Pattern Tester
Test glob patterns (*, **, ?, [abc], {a,b}, !negation) against file paths in your browser. Live matches, regex output, and plain-English explanations.
Glob pattern tester
One pattern per line. Lines starting with # are ignored. Prefix with ! to negate.
One path per line. End a line with / to mark it as a directory.
Results
2 of 7 paths matched the patterns above.
- src/index.ts+1
- src/components/Header.tsx+2
- src/components/Header.test.tsx+2!4
- src/utils/helpers.test.ts+1!3
- src/styles/global.css
- tests/setup.ts
- dist/index.js
Pattern breakdown
Each pattern with its index (used in the badges above), the regex it compiles to, and an explanation in plain English.
- src/**/*.tspositive
^src(?:/.+)?/[^/]*\.ts$
- Positive pattern: matching paths are included.
- Uses ** (globstar): matches zero or more path segments.
- Uses *: matches any run of characters inside one segment.
- src/**/*.tsxpositive
^src(?:/.+)?/[^/]*\.tsx$
- Positive pattern: matching paths are included.
- Uses ** (globstar): matches zero or more path segments.
- Uses *: matches any run of characters inside one segment.
- !**/*.test.tsnegation
^(?:.+/)?[^/]*\.test\.ts$
- Negation: paths that match this are removed from the result.
- Uses ** (globstar): matches zero or more path segments.
- Uses *: matches any run of characters inside one segment.
- !**/*.test.tsxnegation
^(?:.+/)?[^/]*\.test\.tsx$
- Negation: paths that match this are removed from the result.
- Uses ** (globstar): matches zero or more path segments.
- Uses *: matches any run of characters inside one segment.
Glob syntax
- * matches any characters that are not a slash, inside a single segment. src/*.ts matches src/index.ts but not src/utils/index.ts.
- ** matches any number of path segments. Use it between slashes: src/**/*.ts walks every depth.
- ? matches exactly one non-slash character.
- [abc] matches one of the listed characters. Use [a-z] for ranges and [!abc] or [^abc] for negation.
- {js,ts} expands to alternatives: *.{js,ts} matches both .js and .ts files.
- ! at the start of a pattern is a negation that removes paths from the result set.
- / at the end means the pattern only matches directories.
- Escape a literal special character with a backslash: \* matches a real asterisk.
Where this dialect is used
- Build tools: webpack, Vite, Rollup, esbuild, Parcel, Gulp use this style for include and exclude filters.
- Linters: ESLint ignorePatterns and overrides[].files read the same syntax.
- tsconfig: include and exclude use the globstar form.
- npm scripts: prettier, eslint, jest, vitest, mocha all accept these globs.
- CI: GitHub Actions paths and paths-ignore, GitLab CI rules:changes.
- Containers: .dockerignore patterns follow the same star and double-star rules.
- .gitignore has subtly different anchoring and directory rules. Most differences are not glob syntax issues; see the Gitignore Generator for that file format.
How to use
- Pick an example (TypeScript build inputs, Node build artifacts, GitHub Actions path filter, Image assets only, or Character classes) to start from a working pattern set, or paste your own.
- Edit the Glob patterns panel: one pattern per line. Prefix a line with ! to negate a previous match. Lines starting with # are treated as comments.
- Edit the File paths panel: one path per line. End a path with / to mark it as a directory so directory-only patterns can match.
- Watch the Results list update as you type. Matched paths show in green with badges (+1, +2, etc.) for the positive patterns that selected them, and (!1, !2) for any negations that excluded them.
- Open the Pattern breakdown panel to see each pattern compiled to a regex with a plain-English explanation of the syntax it uses.
- Click Copy matched to grab the newline-separated list of matched paths, or Copy regex on any pattern to copy its compiled regular expression.
About this tool
Glob Pattern Tester lets you paste one or more glob patterns and a list of file paths and instantly see which paths each pattern matches. The matcher implements the dialect used by minimatch, picomatch, fast-glob, and node-glob, which is the syntax every developer encounters in webpack, Vite, Rollup, esbuild, Gulp, npm scripts, ESLint ignorePatterns, tsconfig include and exclude, GitHub Actions path filters, GitLab CI rules:changes, and Docker .dockerignore. It supports star for any characters inside a segment, double-star (globstar) for any number of path segments, question mark for exactly one character, square brackets for character classes and ranges, curly braces for alternative expansion, an exclamation mark prefix for negation, and trailing slashes for directory-only matches. Each pattern is also compiled to a regular expression so you can see exactly what is being tested, and a plain-English breakdown explains what every syntax element does. The result list highlights matched paths in green with badges showing which positive pattern selected the path and which negation pattern excluded it, so you can debug ordered ignore rules at a glance. Toggle case sensitivity, show only matches, and copy the matched list as a newline-separated string ready to feed into another script. Everything runs locally; your patterns and paths never leave your browser.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Regex Tester
Live regex testing with highlights, capture groups, and replacement preview.
Open tool
DeveloperGitignore Generator
Build a .gitignore from curated language, framework, editor, and OS templates.
Open tool
DeveloperCrontab Explainer
Translate any crontab to plain English with a field breakdown and next-run preview.
Open tool
DeveloperSemver Comparator
Compare two versions and check if a version satisfies a semver range.
Open tool
DeveloperJSON Flatten Unflatten
Two-way converter between nested JSON and path-keyed flat JSON.
Open tool
DeveloperString Similarity Checker
Levenshtein, Jaro-Winkler, Dice, Jaccard, and cosine scores side by side.
Open tool