I would like to search for a combination of two words (let’s say term1 and term2) inside a bullet list. The condition is that these two words have to be from the same nested list and that the search has to be for any combination of these two words. Nested lists are separated by two new lines \n.
The input text
- Example nested list 1
- This point contains term 2
- This point contains term 1
- Example nested list 2
- This line contains term 2
In order to achieve this I first tried to capture different nested lists in different capture groups.
- ([\s\S]*?)\n\n
Now, I would like to search inside each of these capture groups but I can’t seem to find out how. An example regex is at https://regex101.com/r/OC6OI5/12
Edit: For people who are wondering why this might be useful, I’m trying to build a Roam Research like Linked references filtering in a markdown editor