regex replace html tags

In exporting a odt file to epub LibreOffice can make many mistakes, such as get a 2nd level title not with <h2>, but with <p class=”para0″>. To fix this error, you can use regex, in this way:

find: <p class="para0">(.*?)</p>
replace: <h2>\1</h2>

and so on for similar cases.

regex “whatever”

If you want to select “Whatever” (word or character), regardless of its length, you can simply use

(.*?)

For example if you want delete all the words between <span> and </span>, as in the following row

many words <span>many other words here</span> other words

you can use

delete <span>(.*?)</span>. 

The result will be:

many words other words