How to capture strings between two words/characters

Solution 1:

Using Notepad++


  • Ctrl+F
  • Find what: C-.+D-.+
  • CHECK Match case
  • CHECK Wrap around
  • CHECK Regular expression
  • UNCHECK . matches newline
  • Find Next

Explanation:

C-      # literally C and hyphen
.+      # 1 or more any character but newline
D-      # literally D and hyphen
.+      # 1 or more any character but newline

Screenshot:

enter image description here