(moved from "GREP: finding two identical consecutive strings")
I am working on a "book" containing entries of the following nature:
In this example (4th section), there are the abbreviations "1S", "2K", "Ri", "Jer", and "Gn" (twice). In the whole book, there are 39 such abbreviations in all, and what I should be able to do is find the same abbreviation occurring consecutively, like the second "Gn" instance above ("Gn 1714"), and delete it; as in this example, the two should be in the same paragraph, and they mustn't be separated by a semicolon.
The important thing is that the search should not match if any of the other 39 abbreviations occurs in between, so if there is "1S ... 2K ... Ri ... 1S ...", the second occurrance of "1S" should not match.
I was trying to do 39 different searches (this is not bad considering the size of the book), the first one dealing with the first abbreviation, the second with the second etc. Using GREP, how can I search for "abbreviation 1" not followed by "any of the abbreviations 2 to 39 or a semicolon" followed by "abbreviation 1"? Any hint is very appreciated!
Trying to narrow it down, to make it a bit less complicated:
With GREP, how find string A, not followed by string B or string C, followed by string A – all in the same paragraph, without intervening semicolon?
All I wish to know is whether it is at all possible to do such a GREP Find, and how.