View Single Post
Old 07-19-2013, 11:34 AM   #4
gmw
cacoethes scribendi
gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.gmw ought to be getting tired of karma fortunes by now.
 
gmw's Avatar
 
Posts: 5,818
Karma: 137770742
Join Date: Nov 2010
Location: Australia
Device: Kobo Aura One & H2Ov2, Sony PRS-650
I was thinking a bit more about this, and so far what you have will only work for single word lists: "apples, oranges and pears", but you won't find: "five apples, three oranges and two pears". And I might suggest that it is the more complicated list that is more important one if additional clarity is your goal.

For a more comprehensive match I think you are going to need something like:
Code:
\>,[^,.;"“”]+ and
This will almost certainly find more than you want, probably a lot of false positives, but you are less likely to miss important instances. The quotes are there to stop the search going over quote boundaries - I included plain as well as open/close, you probably can't exclude an apostrophe (because you "can't" ). The full stop is there to stop it at the end of a sentence (obviously), and the semi-colon because it should represent a superior phrase boundary.

You may be able to limit the number of false positives by limiting the amount of text permitted between the comma and the " and":
Code:
\>,[^,."“”]{1,30} and
But of course this risks missing some of the worst offenders.

ETA: I specified the quotes because of what I saw when testing on my fiction writing, in your non-fiction it maybe that you would be better off without the quotes in the exclude list - in case your lists include quoted items.

Last edited by gmw; 07-19-2013 at 11:42 AM.
gmw is offline   Reply With Quote