Created
July 28, 2014 16:11
-
-
Save avidal/b5e2af4e2f618254a0ab to your computer and use it in GitHub Desktop.
amazon url regex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(?:https?://)?(?:[a-zA-Z0-9\-]+\.)?(?:amazon|amzn){1}\.(?P<tld>[a-zA-Z\.]{2,})\/(gp/(?:product|offer-listing|customer-media/product-gallery)/|exec/obidos/tg/detail/-/|o/ASIN/|dp/|(?:[A-Za-z0-9\-]+)/dp/)?(?P<ASIN>[0-9A-Za-z]{10}) | |
I created this a number of years ago for an irc bot (https://github.com/rmmh/skybot) to recognize amazon urls. Keep forgetting to hang onto it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this regex still reliable?