Adding subdomains only/wildcard URI matching

Feature name: Subdomains only URI matching

Feature Description

I’m proposing a URI matcher which matches a domain and its subdomains. Example: would match:

but would not match:

Alternatively a subdomain only matcher would also suffice for this pattern but would require two rules:

I do not prefer one solution over the other.

Clients / Repos Affected:

  • Web
  • Mobile
  • Desktop
  • Docs

Timeline to completion (estimate):

I haven’t looked into the code details but I figure with some digging I could add this feature.

1 Like

You can currently set it to match on subdomains (your second suggestion) using the “Host” matching option.

For your first scenario, this should be possible using “Starts With” or perhaps the “Regular Expression” option. You may need multiple matching rules depending on how complex your requirements are.

More info here:

Startswith cannot do what I described above, it’s only useful for path matching. The only way to match subdomains using host is to create a host entry for every subdomain. This is not feasible as the subdomains in the case I described are dynamic and plenty.

The only way to attain subdomains only matching is via regular expressions at the moment. The problem with this is that regular expressions are notoriously hard to read and easy to mess up.

Perhaps an even better idea is to add an easier to read wildcard system. I’m thinking about:

What I think might also be a good idea is a rules tester. A tool, be it in the extension/app/… or on a separate website, where you can add rules and then test URLs to see if they match. I might be able to take a stab at this.

A useful online tool I’ve used in the past is

1 Like

I don’t mean a tool to test regexes. I am talking about a tool which would allow adding rules, as you can do in bitwarden clients, and consequently test a URL. The tool would then say which of the rules match and which don’t as well as the end result, match or not.

I think @Matthias means this menu:

That sounds a good idea.

I think I will make the test tool into a separate proposal. That way this thread can be solely about adding the proposed new matchers; wildcard and subdomain only.

1 Like