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
foo
not_foo
bar
and the last foo bar block.
foo
bar
I tried multilines regex search with foo.*?bar
, but it returns the 2nd and the 3rd block together
foo
not_foo
--
bar
, which should be ignored since they are separated by --
.
Would like to hear any suggestions.
Thanks.
3