ubin.sh

Glob Tester

Test glob and .gitignore patterns against a list of file paths, with matches highlighted as you type.

/

^src\/(?:.*\/)?[^/]*\.ts$

Paths
2 / 15 matched
src/index.ts
src/app/page.tsx
src/app/layout.tsx
src/components/Button.tsx
src/components/Button.test.tsx
src/lib/utils.ts
src/styles/main.css
public/favicon.ico
public/logo.svg
README.md
package.json
tsconfig.json
.eslintrc.json
dist/index.js
dist/index.js.map

About this tool

Type a glob pattern and a list of file paths; matching paths light up live as you edit either side. Supports *, ** (globstar across directories), ?, [abc] character classes, {a,b} braces, a leading / to anchor to the root, a trailing / for directories, and a leading ! to negate. Patterns without a slash also match a path's basename, the way .gitignore does.

Useful for sanity-checking CI path filters, tsconfig include/exclude, .gitignore rules, and bundler globs before committing them. The compiled regular expression is shown so you can see exactly how the pattern is interpreted.

Frequently asked questions

What is the difference between * and **?+

A single * matches within one path segment and never crosses a slash, so src/*.ts matches src/a.ts but not src/sub/a.ts. The globstar ** matches across directory boundaries, so src/**/*.ts matches any depth under src.

Why does *.ts match src/app.ts?+

A pattern with no slash also matches the basename of a path, mirroring .gitignore. Anchor it with a leading slash (/*.ts) to match only top-level files.

How do I match a directory and everything in it?+

Use dir/** — it matches the directory itself and every path beneath it. A trailing slash (dir/) matches the directory entry.

Does this follow exact .gitignore semantics?+

It covers the common cases (globstar, basename matching, negation, anchoring) but is not a full git implementation — ordering of multiple rules and some edge cases differ. For one pattern at a time it matches what you expect.

Related tools