Skip to content

Instantly share code, notes, and snippets.

@avidal
Created July 28, 2014 16:11
Show Gist options
  • Save avidal/b5e2af4e2f618254a0ab to your computer and use it in GitHub Desktop.
Save avidal/b5e2af4e2f618254a0ab to your computer and use it in GitHub Desktop.
amazon url regex
(?: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.
@AndrewBudziszek
Copy link

Is this regex still reliable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment