Target text example:
foo
not_foo
bar
--
bar
foo
not_foo
--
bar
--
foo
bar
--
I want to find all text that starts with foo and ends with bar, but only within the same --
block.
So the expected result would only return the first and the last foo bar block.
I tried multilines regex search with foo.*?bar
, but it returns the 2nd and the 3rd block together, which should be ignored since they are separated by --
.
Would like to hear any suggestions.
Thanks.