How to capture strings between two words/characters either or both words have multiple occurrences but I want the words both from the first column.
1. A-Hi hello C-0987654321
2. B-Zzzzzzzzzzzz D-Hi
3. C-I want to go to Europe C- Nexy year D-I wish so
4. D-Are
5. E-You
6. F-Test
7. G-Test
8. H-Test
9. I-Test
10.J-Test
Desired Capture: C-I want to go to Europe C- Nexy year D-I wish so
I used regex \C-.+\D- but it captures C-0987654321 B-Zzzzzzzzzzzz
I want to capture between lines 3.C- and 4.D-(all from first column) which is “ C-I want to go to Europe C- Nexy year D-I wish so”
