The particular hangup I faced when using regex was with this URL:
http://vi.ebaydesc.com/ebaymotors/ws/eBayISAPI.dll?ViewItemD...
>>> x = re.compile('(?:(item|t|hr)=(\d+))')
>>> x.findall(url)
[('item', '290277158797'), ('t', '1227377775000')]
I can't for the life of me figure out how to get the hr value. I started messing around with regex again, but no luck so far.
I can do the same with Python's string methods:
>>> hr_start = url.find('hr=')
>>> hr_end = url.find('&',url.find('hr='),len(url))
>>> url[hr_start:hr_end]
'hr=http://shop.ebay.com/?_from=R40'
It's just messy as hell, it'd be nice to do everything in one swoop.