Thread: Regex examples
View Single Post
Old 10-11-2014, 03:59 PM   #429
signum
Zealot
signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.
 
Posts: 119
Karma: 64428
Join Date: Aug 2011
Device: none
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.
signum is offline   Reply With Quote