I am trying to achieve the following, however with the QRegExp class in PyQt4.
I am struggling to find good examples on how to use this class in python.
def html_trap(text):
h ={"&":"&",'"':""","'":"'",">":">","<":"<"}
t=""
for key,value in h.items():
m=re.search(value,text)
if m is not None:
t=text.replace(value,key)
return t
print(html_trap("Grocery " Gourmet Food"))
Thanks