Sample text:
begin
more text
art
id:213213
code:"XXX"
name:234
art-
art
id:543
name:72
code:"AAA"
art-
art
code:"XXX"
id:32
name:46
art-
art
code:"CCC"
id:8765
art-
art
id:876
code:"DDD"
art-
even more text
even more text
end
Target:
Trying to get the groups starting with art
ending with art-
where the group contains "XXX"
.
So i want
art
id:213213
code:"XXX"
name:234
art-
and
art
code:"XXX"
id:32
name:46
art-
Started with regex101 but did not get far.
Tried:
(?sm)(.*?)(?:art.*?art-)(.*?)
And
(?sm)(.*?)(?:art.*?"XXX".*?art-)(.*?)
Any help would be appreciated.