Glob pattern tester
Test file paths against a glob pattern with *, ?, **, {a,b} alternatives and [a-z] character classes.
Input
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
| Name | Type | Required | What 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.
Related tools
- .gitignore testerCheck which paths a .gitignore file ignores and which line decided each one, using real Git matching rules.
gitignore-test - Regex testerTest a regular expression against text and see every match with its position and groups.
regex-test - robots.txt testerCheck which URL paths a robots.txt file allows for a crawler, and which rule decided, following RFC 9309.
robots-test - Cache-Control explainerExplain a Cache-Control header directive by directive and how browsers and CDNs will treat the response.
cache-control-explain - Card number (Luhn) and IBAN validatorCheck a card number with the Luhn checksum and name its network, or check an IBAN by length and mod-97.
luhn-iban-validate - CIDR and subnet calculatorWork out the network, netmask, host range and size of an IPv4 or IPv6 CIDR block, and split it into subnets.
cidr-calc