I would like to search in a text of multiple lines to see if each line has sentence=" followed by some text and ended with " />'. If yes, see if the text between sentence=" and " />' has ", if yes, replace it with '. For example, one such line is:
<number="4" word="start" sentence="I said, "start!"" />
I would like to change it to be
<number="4" word="start" sentence="I said, 'start!'" />
Note that such cases can happen more than once in each single line of the text.
I wonder how to use regex in Python to accomplish that? Thanks!
sentenceattribute is supposed to beinstance? (or vice versa)