ruby - get the ASIN number from amazon URL -


given amazon product url, can either

http://amazon.com/gp/product/asin/* http://amazon.com/*/dp/asin/* http://amazon.com/dp/asin/* 

how scrap asin number url in ruby ? not @ writing regular expressions.

use should find match by:

scan(/https?:\/\/(?:www\.|)amazon\.com\/(?:gp\/product|[^\/]+\/dp|dp)\/([^\/]+)/) 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -