Here's my code:
def regex(product):
p = re.compile('\d{2}%')
result = p.match(product)
print result
return result
My input is something like this:
<em id="productYoyo_Relative">-25%</em>
The -25% changes all the time. So I just want to grab the 25 for comparison.
I've looked at Python's docs for regex, that's how I wrote what I have. Also, I tested my regular expression on gskinner and it worked there. Am I not implementing Python's regex correctly?
This post has been edited by Gamegoofs2: 15 September 2012 - 09:23 AM

New Topic/Question
Reply



MultiQuote




|