View Single Post
Old 01-01-2016, 11:17 PM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
I use a few for finding missing opening and closing quotes. They aren't perfect and I have to look at the matches before making changes.

Missing opening quote:
Code:
(<p>)([^“]*\”.*</p>)
With the replace:
Code:
\1“\2
Missing open quote between closes:
Code:
”([^“]*\”)
This doesn't have a replace string as I have to work out where the quote is missing. And in lot of cases, the wrong quote was used.

Missing closing quote:
Code:
“[^”]+?<p>“
Again, I have to work out where the missing quote should go. Or it it is needed when one persons dialog continues over multiple paragraphs.

These aren't perfect and I have to look at the matches before making changes.

There is a sticky thread in the Sigil forum with a lot of Regex example. It has a lot of good suggestions like this. I think the first one came from it.
davidfor is offline   Reply With Quote