Enable use of regexp for matching sites #340
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enables the use of regular expressions to match the correct keepass entries for the provided url.
To use this add a string field for the keepass entries named
KeePassHttp Settings
and set the value to{"RegExp":"WHATEVER_URL_REGEXP"}
.In WHATEVER_URL_REGEXP (replace with the actual regexp you want to use) you have to escape every
\
with an additional\
so that the regular expression for matching the character/
for example would result in\\/
or for the character\
it would be\\\\
. This is because the value is stored as a JSON string which itself uses\
for character escaping.Example url matches for url
https://example.org/this/is/a/path?with¶meters
:{"RegExp":"^https:\\/\\/example.org\\/this\\/is\\/a\\/path\?with¶meters$"}
(exact match){"RegExp":"^https:\\/\\/example.org\\/this\\/is\\/a\\/path\?.*$"}
(with¶meters
can be anything){"RegExp":"^https:\\/\\/example.org\\/this\\/is\\/a\\/path\?"}
(same:with¶meters
can be anything){"RegExp":"^https:\\/\\/example.org\\/"}
(all urls on example.org){"RegExp":"^https:\\/\\/.*\.example.org\\/"}
(all urls on example.org including subdomains for example.org){"RegExp":"^https:\\/\\/example.(org|com)\\/"}
(all urls on example.org and example.com){"RegExp":"example.org\\/"}
(matches all protocols for example.org (https, http, ftp, etc.) BUT ALSO all urls that has....example.org/....
in it