I have this, which gives no match, why ?:
>>> p = r'abc'
>>> cp = re.compile(p, re.IGNORECASE)
>>> m = cp.search('ABC', re.IGNORECASE)
>>> m # NO MATCH # 1
But, this gives a match, why ?
>>> m = cp.search(' ABC', re.IGNORECASE) # introduced spaces, ABC no longer at the beginning
>>> m # MATCH # 2
<_sre.SRE_Match object at 0x1082b5ac0>
To get a match in #1 all I have to do is drop re.IGNORECASE, why so ?
>>> m = cp.search('ABC')
>>> m
<_sre.SRE_Match object at 0x10827e308>