Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Fix URI vault regex example #393

Merged

Conversation

ypid
Copy link
Contributor

@ypid ypid commented Feb 10, 2021

I find it important that examples actually follow best practices. The current regex does not escaping dots in URIs when writing regex is a mistake that is often made, even by advanced regex people. I think this comes from the way we humans look at URIs. Dots are so common in there, aren’t they? Yes, but we write proper regular expressions here, not something in between.

Note: This is just a quick fix, please consider #158 (additionally)

Fixes: #392
Updates: #41
Full fix: #158
Replaces: #160

@CLAassistant
Copy link

CLAassistant commented Feb 10, 2021

CLA assistant check
All committers have signed the CLA.

@ypid ypid force-pushed the fix/uri-regex-alternative-patch branch from defd5af to bdb09a7 Compare February 10, 2021 19:11
@ypid ypid changed the title Add regex example to "Match detection for URIs" that is not broken Fix URI vault regex example Feb 10, 2021
Copy link
Contributor

@fschillingeriv fschillingeriv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgive my ignorance, but does this better-formed example prevent matching on https://malicious-site.com?q=google.com? If so, let's move https://malicious-site.com?q=google.com down to the Auto-fill not offered for list.

I find it important that examples actually follow best practices. The
current regex does not escaping dots in URIs when writing regex is a
mistake that is often made, even by advanced regex people. I think this
comes from the way we humans look at URIs. Dots are so common in there,
aren’t they?  Yes, but we write proper regular expressions here, not
something in between.

Updates: bitwarden#41
Alternative: bitwarden#158
Replaces: bitwarden#160
@ypid ypid force-pushed the fix/uri-regex-alternative-patch branch from bdb09a7 to 6d32f5a Compare February 10, 2021 19:49
@ypid
Copy link
Contributor Author

ypid commented Feb 10, 2021

Both me and the rebase from #160 made a mistake that you noticed and I just fixed. Thanks! It does not prevent that and I updated the initial comment accordingly.

@fschillingeriv
Copy link
Contributor

Great! I'll approve & merge this PR, and then hop over to #158

@fschillingeriv fschillingeriv merged commit 2b9d4c6 into bitwarden:master Feb 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mistake in regex example in URI detection documentation
3 participants