Glob pattern tester

Test file paths against a glob pattern with *, ?, **, {a,b} alternatives and [a-z] character classes.

Input

The glob pattern.
The paths to test, with forward slashes.
Treat upper and lower case as different.
Let * and ** match names that start with a dot, such as .env.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/glob-test \
  -H 'Content-Type: application/json' \
  -d '{"input":{"pattern":"src/**/*.{js,ts}","paths":["src/app.js","src/lib/util.ts","src/lib/readme.md","test/app.js"]}}'
import json, urllib.request

body = {'input': {'pattern': 'src/**/*.{js,ts}', 'paths': ['src/app.js', 'src/lib/util.ts', 'src/lib/readme.md', 'test/app.js']}}
request = urllib.request.Request("https://setget.net/v1/tools/glob-test", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/glob-test", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"pattern":"src/**/*.{js,ts}","paths":["src/app.js","src/lib/util.ts","src/lib/readme.md","test/app.js"]}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "glob-test",
  "input": {
    "pattern": "src/**/*.{js,ts}",
    "paths": [
      "src/app.js",
      "src/lib/util.ts",
      "src/lib/readme.md",
      "test/app.js"
    ]
  }
}
{
  "input": {
    "pattern": "src/**/*.{js,ts}",
    "paths": [
      "src/app.js",
      "src/lib/util.ts",
      "src/lib/readme.md",
      "test/app.js"
    ]
  }
}

Endpoint: POST /v1/tools/glob-test. Over MCP: run_tool with slug: "glob-test". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
pattern string yes The glob pattern.
paths array yes The paths to test, with forward slashes.
case_sensitive boolean no Treat upper and lower case as different. Default: true.
dot boolean no Let * and ** match names that start with a dot, such as .env. Default: false.

Examples

Input
{
  "pattern": "src/**/*.{js,ts}",
  "paths": [
    "src/app.js",
    "src/lib/util.ts",
    "src/lib/readme.md",
    "test/app.js"
  ]
}
Result
{
  "results": [
    {
      "path": "src/app.js",
      "matches": true
    },
    {
      "path": "src/lib/util.ts",
      "matches": true
    },
    {
      "path": "src/lib/readme.md",
      "matches": false
    },
    {
      "path": "test/app.js",
      "matches": false
    }
  ],
  "matched": [
    "src/app.js",
    "src/lib/util.ts"
  ],
  "count": 2
}

A single star stays inside one folder

Input
{
  "pattern": "*.txt",
  "paths": [
    "notes.txt",
    "docs/notes.txt",
    ".hidden.txt"
  ]
}
Result
{
  "results": [
    {
      "path": "notes.txt",
      "matches": true
    },
    {
      "path": "docs/notes.txt",
      "matches": false
    },
    {
      "path": ".hidden.txt",
      "matches": false
    }
  ],
  "matched": [
    "notes.txt"
  ],
  "count": 1
}

Questions

What is the difference between * and **?
* matches within one folder name and never crosses a slash. ** as a whole path part matches any number of folders, including none.
Why did a file starting with a dot not match?
As in most shells, wildcards skip hidden names unless the pattern itself starts that part with a dot. Set dot to true to include them.
Does "src/**" match "src" itself?
No. A final ** needs at least one more path part, so it matches everything inside src.