Apr 29 2022 09:35 AM
Hello!
I am a complete wildcard novice, so there is a more than likely chance that I am missing something incredibly obvious here.
I often work on documents that contain numbered lists. The most common of these lists are numbers in parentheses like this:
(1) The cat sat on the mat.
(2) The dog sat with the cat.
(3) The dog and cat sit on the mat.
In practice, there can be any amount of text for a list item, and there are often sub-lists like so:
(1) The cat sat on the mat
(a) The cat was brown
(b) The cat was soft
(2) The dog sat with the cat
I have been trying to work on a wildcard search that would make sure a (1) is followed by a (2) as there are often times that authors make a list with only one item, and we don't allow lists unless there is more than one list item. I'm choosing to focus on the (1) followed by (2) issue right now and thought I would hopefully tackle the (a) followed by (b) issue with what I learn.
Okay, hopefully that explains the situation. Here is what I have tried so far:
([\(]1[\)])(*)(^013^t)[![\(]2[\)]]
Here, I was trying to search for (1) followed by any characters, followed by a hard return, followed by a tab, I was hoping it would then ignore results if the tab was followed by (2). However, when trying to run this search, I got a "The Find What text contains a range that is not valid" error message. My favorite
(\(1\))(*)(^013^t)([!\(2\)])
I then tried messing with the structure a little bit and came up with this. This search DOES run, but it doesn't pull up the results I would expect. This finds the (1), but then it seems to keep searching the text until there is a hard return, a tab, and then text not surrounded by parentheses like so:
(1) Sample text
(2) Sample text
(3) Sample text
Sample text
So there is clearly something wrong with the "except" portion of the search, but for the life of me I cannot figure out what.
I've tried about a dozen other combinations, but the wildcard above is really the closest I've gotten to actual results. I would graciously accept any advice anyone is willing to give.
P.S. these are manually typed lists and not automatically generate ones.