I have a large file that I need to find when a tag is absent from certain blocks. For example-
begin
test
stuff here
1234
end
begin
other stuff
key
end
I would like to find each begin-end section that does not contain the key
field. So in this example I would match on the first begin-end section but not the second.
I was able to match each section using begin(.|\n)+?end
but I couldn't figure out how to only match the sections without the key
in it. I was reading about backreferences but I couldn't figure out how to use those in this situation either.