Quote:
Originally Posted by signum
In my opinion, I don't think it's possible to write a single regular expression to do what you want. REs are not a general programming language and are quite limited in some respects. I wrote a short program to step through an htm file and find the number of ldquos, rdquos and quots in each paragraph. If the number of ldquos didn't equal the number of rdquos or the number of quots was odd, it adds a class="unbal" to the paragraph. Regular expressions are usually incapable of counting, comparing two registers or taking the modulus of a number. I would be pleased to be shown wrong, using the RE syntax in Sigil.
|
That is also a different case.
Note that my, WORKING, solution is not a true regular expression either. But regular expressions are not nearly as useful as regex+lookaround, so it was decided that regular expressions need not in fact be regular.