here is a regex i got from: a blog i can't link to because i am new... just google amazon short url and click on the blog post by noah coad
as you can see from this page... it is supposed to extract the unique product id from any amazon url so you can shorten it... or use it to pull info from amazon apis.
here is the sample code i am trying to use to get it to work:
<?php
$example_url = 'http://www.amazon.com/dp/1430219483/?tag=codinghorror-20';
$reg = '(?:http://(?:www\.){0,1}amazon\.com(?:/.*){0,1}(?:/dp/|/gp/product/))(.*?)(?:/.*|$)';
echo 'test<br/>';
echo preg_match($reg,$example_url);
?>
and here is my output:
test
Warning: preg_match() [function.preg-match]: Unknown modifier '(' in /Users/apple/Sites/amazon/asin_extract.php on line 14
thanks so much! this is my first time posting on this site where i have found countless answers already
on second hand... take back some of my thanks for this painful first time submission process... i had to trim this question since it thinks my regex patterns are urls