Thread: Regex examples
View Single Post
Old 03-05-2013, 11:30 AM   #198
mzmm
Groupie
mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.
 
mzmm's Avatar
 
Posts: 171
Karma: 86271
Join Date: Feb 2012
Device: iPad, Kindle Touch, Sony PRS-T1
Quote:
Originally Posted by Ripplinger View Post
I couldn't get that to work at all and was about to give up and then realized you didn't use the curly smart quotes. Once I changed it to smart quotes, it would work somewhat, but it will also pick up any sentence or paragraph that doesn't immediately start with a quote. So it would pick up paragraphs like this:

Pamela shuddered. “We’ve been making ourselves polite to a murderess.”

And there's usually far too many of those types of sentences to want to read through over 500 of them to find the beginning quote buried further in.
try this? it'll probably still miss some (like if the closing quote butts up against a </span> instead of a </p> for example) so you'd probably want to scan the text afterwards but it might save you some copy/pasting.

Code:
find: (<p[^>]*>)(?:\s+)?([^“]+?”)(?:\s+)?(</p>)

replace: \1“\2\3

Last edited by mzmm; 03-05-2013 at 11:38 AM.
mzmm is offline   Reply With Quote