i am not able to figure out why the below two print statements gives different results. can any one please explain me? i am just giving a small sample example. in the first print statement table is getting replaced by a special character and the second one gives correct one.
import re
def tblcnv( str ):
rtval = re.sub("table", "chair", str)
return rtval
rval = "<table is in the place where you sit daily "
tblcnt = re.sub(r"<(table.*place)", tblcnv('\1'), rval)
print tblcnt
print tblcnv("<table is in the place where you sit daily")
D:\Python>tbl.py☺ where you sit daily<chair is in the place where you sit daily