@Thom*-- See:
s&r for paired tags
I recommended something like:
Code:
<span(?: class="calibre5")?>((?:(?!<span).)*?)</span>
to match all content inside those span tags, unless there is another span tag in the content.
But really, the OP should avoid the problem to begin with, by opening his DOCX in the editor directly. It will be converted into an EPUB for editing --
without having the CSS flattened!
Or use Toxaris' Word addin.
calibre's conversion is meant for finished products, to move to another device. And usually by end-users, not content creators. That is why the editor was designed to avoid the creation of tag soup.