Glob cheat sheet
A rule pattern uses * and ? as wildcards. What * matches depends on the kind of pattern.
A full pattern has a host and a path, for example meet.google.com/*. The rule editor writes this kind. A domain-only pattern tests the host alone, with no port and no path. Rules made from some presets carry this kind.
| Pattern | What it matches | Example |
|---|---|---|
* in a full pattern | Anything, including dots and slashes. | meet.google.com/* |
* in a path | Anything, including dots and slashes. | example.com/docs/* |
* in a domain-only pattern | One segment of the host. It does not cross a dot. | dev-*.example.com |
*. at the start of a domain-only pattern | Any chain of subdomains, or none. The base domain matches too. | *.example.com matches example.com |
? | Exactly one character. | example.com/v?/* |
. and / | Themselves only. | example.com/ |
Case does not matter. A pattern must match the whole text, not part of it. A second * after a *. prefix is a plain character, so *.staging.* does not work.
Worked examples
Section titled “Worked examples”| Pattern | Matches | Does not match |
|---|---|---|
meet.google.com/* | meet.google.com/abc-defg-hij | mail.google.com/inbox |
*.google.com/* (full pattern) | mail.google.com/inbox, docs.google.com/document/1 | google.com/search. A full pattern needs the dot before google.com. |
*.example.com (domain-only) | example.com, a.b.example.com | example.com.evil.net, myexample.com |
dev-*.example.com (domain-only) | dev-alice.example.com | dev-alice.staging.example.com |
example.com/v?/* | example.com/v1/api | example.com/v10/api |
For how the rule editor builds a pattern, see Match a link with a simple pattern.