I need to do something like this:
st = 'abcdef'
wr = 'ab'
if re.search(^wr,st):
print 'OK'
the problem is I cannot combine special character with a variable (i.e. ^wr). Is there a way to do that?
I need to do something like this:
st = 'abcdef'
wr = 'ab'
if re.search(^wr,st):
print 'OK'
the problem is I cannot combine special character with a variable (i.e. ^wr). Is there a way to do that?