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

Glib GIOChannel -

jsp - java.sql.SQLException: [Microsoft][ODBC Microsoft Access > Driver] Too few parameters. Expected 1 -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -