Python library for matching URLs.
Use urlmatch to verify that URLs conform to certain patterns. The library and match patterns are based heavily on the Google Chrome Extension match patterns.
from urlmatch import urlmatch match_pattern = 'http://*.example.com/*' urlmatch(match_pattern, 'http://subdomain.example.com/') # True urlmatch(match_pattern, 'http://sub.subdomain.example.com/') # True urlmatch(match_pattern, 'https://example.com/') # False urlmatch(match_pattern, 'http://bad.com/') # False
There are a few options that affect how the match patterns work.
The basic match pattern syntax is simple:
<url-pattern> := <scheme>://<host><path> <scheme> := '*' | 'http' | 'https' <host> := '*' | '*.' <any char except '/' and '*'>+ <path> := '/' <any chars>
If you find an issue, let me know in the issues section!
From the Rubinius contribution page:
Writing code and participating should be fun, not an exercise in perseverance. Stringent commit polices, for whatever their other qualities may bring, also mean longer turnaround times.
Submit a patch and once it’s accepted, you’ll get commit access to the repository. Feel free to fork the repository and send a pull request, once it’s merged in you’ll get added. If not, feel free to bug jessepollak about it.
Once you’re ready:
Once it’s accepted:
git remote set-url origin firstname.lastname@example.org:jessepollak/urlmatch.git
Otherwise, you can continue to hack away in your own fork.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|File Name & Checksum SHA256 Checksum Help||Version||File Type||Upload Date|
|urlmatch-1.0.1.macosx-10.12-x86_64.tar.gz (7.9 kB) Copy SHA256 Checksum SHA256||any||Dumb Binary||Jun 2, 2017|
|urlmatch-1.0.1.tar.gz (5.0 kB) Copy SHA256 Checksum SHA256||–||Source||Jun 2, 2017|