Why i am not able to find the match?
>>> ti = "abcd"
>>> tq = "abcdef"
>>> check_abcd = re.compile('^abcd')
>>> if check_abcd.search(ti) is check_abcd.search(tq):
... print "Matching"
... else:
... print "not matching"
...
not matching
Eventhough both variables ti and tq are matching and having same reference
>>> print check_abcd.search(ti)
<_sre.SRE_Match object at 0x7ffbb05559f0>
>>> print check_abcd.search(tq)
<_sre.SRE_Match object at 0x7ffbb05559f0>
Why it is not matching?
if check_abcd.search(ti).group() == check_abcd.search(tq).group():