Consider the input:
=sec1= some-line some-other-line foo bar=baz =sec2= c=baz
If I wish to process only =sec1= I can for example comment
I've used:
sed '/begin/,/end/{/begin\|end/!p}'
This will search all the lines between the patterns, then print everything not containing the patterns