I know similar questions exist for this topic but I've gone through them and still couldn't get it.
My python program retrieves a subsection of html from a page using a regular expression. I just realised that I hadn't accounted for html special characters getting in the way.
say I have:
regex_title = ['I went to the store', 'Itlt's a nice day today', 'I went home for a rest']
I obviously want to change lt'
to a single quote '.
I've tried variations of:
for each in regex_title:
if 'lt'' in regex_title:
str.replace("lt'", "'")
but had no success. What am I missing.
NOTE: The purpose is to do this without importing any more modules.