The given example (http://www.tutorialspoint.com/python/py ... ssions.htm) doesn't seem to work.
This matches a previously matched group again:
([Pp])ython&\1ails Match "python&rails or Python&Rails"
Put this in to the previous Cats example
line = "Python&Rails";
matchObj = re.match( r'([Pp])ython&(\1ails)', line, re.M|re.I)
print "matchObj.group() : ", matchObj.group()
print "matchObj.group(1) : ", matchObj.group(1)
print "matchObj.group(2) : ", matchObj.group(2)
print "No match!!"
[Finished in 0.1s]
Change the line to "Python&Pails" then it's Okay.