I\'ve got some JavaScript that looks for Amazon ASINs within an Amazon link, for example
http://www.amazon.com/dp
You need to use a lookahead to filter the /e/*
ones out. Then trim the leading /e/
from each of the matches.
var source; // the source you're matching against the RegExp
var matches = source.match(/(?!\/e)..\/[A-Z0-9]{10}/g) || [];
var ids = matches.map(function (match) {
return match.substr(3);
});
In your case an expression like this would work:
/(?!\/e)..\/([A-Z0-9]{10})/
([A-Z0-9]{10})
will work equally well on the reverse of its input, so you can