Using Word 2013 ...
Say I have a document that has lots of instances of similar but not exactly the same text between paragraph marks, like so:
text text text ¶
somethingXYZsomething¶
text text text ¶
stelseXYZstelse ¶
text text text¶
thirdXYZthird¶
text text text¶
... and so on.
I want to replace the lines that have "XYZ" in them with a pair of paragraph marks ¶¶ (or, to put it another way, to delete all the text on that line).
My initial effort was to use Find/Replace with wildcards and the following (assume "XYZ" does not have to be case sensitive).
Find: ^13*xyz*^13
Replace with: ^p^p
Unfortunately, Word starts with the first ¶ it encounters and selects all the text through the next "XYZ" (including intervening paragraphs) and then proceeds until the next ¶ after "XYZ."
I looked around and did not see a way to say "the nearest ¶ to the given string."
Any ideas?
Thanks!