I want to remove all multi-line occurrences of a pattern, e.g.
{START-TAG
foo bar
ID: 111
foo bar
END-TAG}
{START-TAG
foo bar
ID: 222
foo bar
END-TAG}
{START-TAG
foo bar
ID: 333
foo bar
END-TAG}
I want to remove all parts between START-TAG and END-TAG that contain specific identifiers.
So, to remove ID: 222, this will remain:
{START-TAG
foo bar 2
ID: 111
foo bar 3
END-TAG}
{START-TAG
foo bar 2
ID: 333
foo bar 3
END-TAG}
I have a blacklist of identifiers that need to be removed.
I assume this will make a fairly simple multi-line serial expression script. Can anyone help?
This is very similar to the question: sed multiline replace , but not the same.
Bastl source
share