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:
review.example.com 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.

3 Likes

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:

https://bitwarden.com/help/article/uri-match-detection/

1 Like

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.

1 Like

A useful online tool I’ve used in the past is https://regexr.com

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.

1 Like

I think @Matthias means this menu:


That sounds a good idea.

2 Likes

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.

2 Likes

What are you trying to achieve @Clovis?

@Matthias Have you had any luck on this wildcard idea? I think it would be helpful to those that are not as regex knowledgable as they would need to be to add relatively simple matching rules.

Also, Did you ever create a rules tester idea? I would certainly like to see it implemented and would like to add my support.

1 Like

I know this is not quite what OP was looking for but this is a feature that I did not notice existed and it solves my use case. Thanks for posting!