I am stuck on a Regex problem. Sample Text
data-key=foo1,
data-key=foo2,
data-key=foo3,
BAR,
data-key=foo4,
asd
data-key=foo5,
asfda
data-key=foo6,
I now want all data-key lines after the word "BAR". Desired Result:
data-key=foo4,
data-key=foo5,
data-key=foo6,
This RegEx would give me the result I want, but I don´t want to specify how many times the data-key line occurs, as it could be any number:
(?s)BAR.*(data-key.*?,).*(data-key.*?,).*(data-key.*?,)
Any ideas?