I have the following text:
string = "<i>R</i> subspace <i>{V.</i> generated by <i>{v<sub>1</sub>,...,v<sub>i</sub></i>, "
A careful reader might notice that there are two brackets missing. I was wondering, how this could be fixed using Python?
The expected output would be:
the <i>R</i> subspace <i>{V.}</i> generated by <i>{v<sub>1</sub>,...,v<sub>i</sub>}</i>,
One could:
- Check: Is there a bracket after
<i>
? - If yes -> Is there a bracket before
</i>
?
How can I code this?
Edit
I have found this code, that can tell you if the brackets match or not.