# Glob pattern tester

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

- Endpoint: `POST https://setget.net/v1/tools/glob-test` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `glob-test`
- Page: https://setget.net/tools/glob-test

## Inputs

- `pattern` (required, string): The glob pattern.
- `paths` (required, array): The paths to test, with forward slashes.
- `case_sensitive` (optional, boolean, default `true`): Treat upper and lower case as different.
- `dot` (optional, boolean, default `false`): Let * and ** match names that start with a dot, such as .env.

## Example 1

```json
{"input":{"pattern":"src/**/*.{js,ts}","paths":["src/app.js","src/lib/util.ts","src/lib/readme.md","test/app.js"]}}
```

Result:

```json
{"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}
```

## Example 2: A single star stays inside one folder

```json
{"input":{"pattern":"*.txt","paths":["notes.txt","docs/notes.txt",".hidden.txt"]}}
```

Result:

```json
{"results":[{"path":"notes.txt","matches":true},{"path":"docs/notes.txt","matches":false},{"path":".hidden.txt","matches":false}],"matched":["notes.txt"],"count":1}
```

**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.
