-1

I have some string that looks like this

 staring line 
 [start][10]
   this is a good content
 [end]
 
  [start][190]
   Wow next content
 [end]
  .....more stuff here

For the above i would like to capture the words in between start and end and output in an array but am new to the regex expressions. so the output would be something like

["this is good content","Wow next content"]

So for me i have tried

const output = sentence.match(/([start])([end])/g)

But the above doesnt work.

How can i make this work

Geoff
  • 6,277
  • 23
  • 87
  • 197

0 Answers0