hi,
I´m trying to build replacement code for ebay.de affiliate links, and I got stuck finding the right regex
I need to extract the sellers name from an URL, which usually looks like this:
http://shop.ebay.de/merchant/user_name
works perfectly fine with:
http://shop\.ebay\.de/merchant/([\.\w_-]+)
then I can use the sellers name as $p1
however, sometimes ebay puts thos "W0QQ" variables behind it, then it would look something like this:
http://shop.ebay.de/merchant/user_name_W0QQ_nkwZQQ_armrsZ1QQ_fromZQQ_mdoZ
I need "_W0QQ" and everything after that to be excluded from $p1
first I tried to create a break at the first instance of an underscore, but then I realized usernames can contain underscores as well.
thanks in advance!
|