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.
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.
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 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.
@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.