I have a string. Let's call it 'test'. I want to test a match for this string, but only using the backref of a regex.
Can I do something like this:
import re
for line in f.readlines():
if '<a href' in line:
if re.match('<a href="(.*)">', line) == 'test':
print 'matched!'
? This of course, doesn't seem to work, but I would think that I might be close? Basically the question is how can I get re to return only the backref for comparison?