url-regex
url-regex copied to clipboard
Email addresses are returned
Hey there!
We're using this library to pull urls out of a user input string. We're currently running into a problem where it returns email addresses.
'This is an [email protected]'.match(urlRegex({ exact: false, strict: false }));
// returns ['[email protected]']
I think it should return no matches in this case.
I came across this as well in a different scenario.
The issue seems to stem from the auth part of the basic authentication scheme, which has been removed from Chrome.
Would you be interested in a PR that creates an opt-out from basic authentication?
I think that would make sense. Basic auth urls seem pretty obsolete now-a-days.
This issue is fixed in my maintained and modern version of this package at https://github.com/niftylettuce/url-regex-safe. You should be able to switch from url-regex to url-regex-safe now. See the updated list of options as I added some new ones, and changed a few defaults to more sensible ones (since not everyone is parsing Markdown for instance).