# Glob patterns

How Axle matches the workspace patterns in pnpm-workspace.yaml and package.json, and the patterns in axle.toml.

Workspace patterns are matched against folder paths relative to the repository's root, with `/` as the separator on every system. The patterns in [axle.toml](https://axlers.dev/docs/reference/configuration.md) use the same symbols: `projects` is matched against folder paths too, and a task's `outputs` and `inputs`, `globalInputs` and `[watch]` `ignore` are matched against file paths.

| Pattern            | Matches                                                                        |
| ------------------ | ------------------------------------------------------------------------------ |
| `apps/*`           | every folder directly inside `apps`, such as `apps/web`, but not deeper        |
| `packages/**`      | every folder at any depth inside `packages`, such as `packages/tools/lint`     |
| `!packages/old`    | leaves that folder out, even when another pattern matches it                   |
| `apps/web`         | exactly that folder                                                            |
| `{apps,tools}/*`   | every folder directly inside `apps` or `tools`                                 |
| `packages/ui-?`    | `?` stands for one character, such as `packages/ui-a`                          |
| `packages/ui-[ab]` | one of the characters between the brackets: `packages/ui-a` or `packages/ui-b` |

- `*` and `?` never match a `/`. Only `**` goes deeper.
- A leading `./` and a trailing `/` are ignored, so `./apps/*/` is the same as `apps/*`.
- Axle never looks for packages inside `.git`, `.axle`, `node_modules` or a folder Git ignores.
- A folder only becomes a package when it also contains a `package.json`.
- A pattern that matches no package is allowed, and Axle [warns](https://axlers.dev/docs/messages/pattern-matches-nothing.md) about it. A broken pattern is an [error](https://axlers.dev/docs/messages/invalid-pattern.md).
