A regular expression to match everything between two occurrences of two words, both of which appear more than once

I want to parse this json and pull out everything that appears between the first occurrence of the word feed and the first instance of the word widget_standard .

I suppose this should be simple enough, but my regex actually matches everything related to the first input of the feed and the second appearance of widget_standard.

What do I need to do for my regular expression /(feed=http.*widget_standard)/i to match only (and including) the end of the first occurrence of the word widget_standard ?

+4
source share
1 answer

Use lazy star to match .*? in the following way:

 /(feed=http.*?widget_standard)/i 
+7
source

All Articles