View Single Post
Old 01-22-2025, 08:37 AM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,805
Karma: 6000000
Join Date: Nov 2009
Device: many
Why use look ahead and behinds given smart quotes make begin and end directional?

Have you tried something simpler like:

“[^”]*\s(were)[,;!?.\s][^“”]*”

So it looks for a starting quote, then any number of things that are not an ending quote followed by a space then the word in question followed by either a space or punctuation marks, then followed by any number of things that are not a beginning or ending quote, and then finally an ending quote.

Give a version of that a try.

We use this approach when using regex to find the next opening or closing tag by replacing the smart quotes with < and >

Last edited by KevinH; 01-22-2025 at 09:45 AM.
KevinH is offline   Reply With Quote