hildogjr / KiCost

Build cost spreadsheet for a KiCad project.
MIT License
496 stars 97 forks source link

Improved validation of datasheet URLs #430

Closed daglem closed 3 years ago

daglem commented 3 years ago

The previous validation regex for datasheet URLs was a bit too strict, e.g. it rejected URLs with query parameters.

This is replaced with the URL validator in the validators library, based on work by Diego Perini: https://gist.github.com/dperini/729294

A comparison chart for regex based URL validators can be found at https://mathiasbynens.be/demo/url-regex

hildogjr commented 3 years ago

Interesting package for validation. Could you change the from validators import url to from validators import url as validate_url or something like?

A url function appear too generic name for the code file.

hildogjr commented 3 years ago

Thanks @daglem for the contribution.