-
Notifications
You must be signed in to change notification settings - Fork 11
Rules
Madis Liias edited this page Sep 21, 2024
·
5 revisions
URL contains of scheme://domain/path?query#fragment
. (No basic auth user:password or port support at this point. Could extend domain to user:password@host:port
in future. Let me know if you need that)
We match them with home-made pattern format (always a good idea, right!), based vaguely on globs and Ant Patterns. It is not thoroughly tested and can contain bugs. Please report if you find any. Also please report if it's not powerful enough and what would you want to do.
Pattern wildcards:
- domain, path and query accepts
*
for single component (exactly one) and**
for all (zero or more) components- domain components are
a.b.c
- path components are
a/b/c
- query components are
a&b&c
- domain components are
- scheme and fragment accept
*
Examples:
-
"github.com"
matches any scheme, exact domaingithub.com
, any path, any query and any fragment. Same as*://github.com/**
. -
"https://github.com"
matches exact schemehttps
, exact domaingithub.com
any path, any query and any fragment. Same ashttps://github.com/**
. -
"github.com/Browsers-software"
matches any scheme, exact domaingithub.com
, exact path/Browsers-software
, any query and any fragment. Same as*://github.com/Browsers-software/
. -
"github.com/Browsers-software/**"
matches any scheme, exact domaingithub.com
, any path starting with/Browsers-software/
any query and any fragment. Same as*://github.com/Browsers-software/**
. -
"https://github.com/**/end"
matches exact schemehttps
, exact domaingithub.com
, any path ending with/end
, any query and any fragment. -
"https://github.com/"
matches exact schemehttps
, exact domaingithub.com
, exact path/
, any query and any fragment. -
"https://github.com/?#"
matches exact schemehttps
, exact domaingithub.com
, exact path/
, empty query
You can't differentiate between exact url https://github.com
without the trailing /
and https://github.com/
with the trailing /
. But I also don't see a use-case for that.
More examples for domains:
-
*.youtube.com
matches<subdomain>.youtube.com
-
**.youtube.com
matchesyoutube.com
,<subdomain>.youtube.com
and<subdomain>.<subdomain>.youtube.com
etc -
**.youtube.*
matches same as previous but with any top-level-domain