I am trying to understand why the following use of regular expressions does not work, i.e. the pattern is not found in the string (general expression of re.sub is re.sub(pattern, repl, string). Can you please tell me why and, if possible, explain how could I have altered the code to make it work?
import re
string = " Many of them are not just serving time in prison, but they are being let out of prison and back into our communities, having committed appalling crimes. They are not being kicked out.</p><p><i>[</i></p><p><i>Interruption.</i></p><p><i>]</i></p><p>And no doubt they are indeed receiving benefits. That is why the British people are fed up and want action to be taken. It is unlikely that my hon."
testOutput = re.sub(r'</p><p><i>[</i></p><p><i>Interruption.</i></p><p><i>]</i></p><p>',' ',string)
print(testOutput)