Quote:
Originally Posted by Man Eating Duck
I should have known that including a regex example, even in a footnote, would be distracting and a bad idea
|
Sorry, I couldn't resist.
Especially considering your use of the phrase "an intuitive regex." I just found it amusing that the solution to the problem you presented was one that was very
intuitive for me.
Quote:
Originally Posted by Man Eating Duck
IThis is not only an attempt to avoid HTML/Regex madness, but to semi-automate a set of tasks I find myself doing manually over and over again. It might also be helpful for the people creating the epubs in the first place
|
Understood. I hope you get your wish -- as long as it doesn't break something else I rely on.
Quote:
Originally Posted by theducks
If you run the cleanup above, you end with broken first and last spans
|
Yep. You'd have to run two or three passes to clean that up:
Code:
<span>([^>]*?)</span>
followed by
Code:
<span class="normal">([^>].*?)</span>
Both replaced with \1
Provided the spans were being applied consistently, of course.
Sorry ... last hijack. I promise.