View Single Post
Old 02-22-2012, 06:25 PM   #6
mmat1
Berti
mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.mmat1 ought to be getting tired of karma fortunes by now.
 
mmat1's Avatar
 
Posts: 1,197
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
Quote:
Originally Posted by MacEachaidh View Post
Is there a straightforward way to convert plain ASCII quotes to "smart" or "typographic" quotes?
How would you describe the text, where an opening quote is? I guess, there's some white space or a <p> before and some letters after a opening quote.

In regex this should be
Code:
(<p>|\s)"(\w)
replaced with
Code:
\1&ldquo;\2
. For closing quotes:
Code:
(\S)"(\s|</p>)
.

I hope i got this regex right, i'm still on a learning curve as well . But in general it should work in most (maybe not all) cases.
mmat1 is offline   Reply With Quote