sed: delete regex line and next line if blank

Hi,

I want to write a sed script which from

batiato:

batiato/giubbe:
pip_b.2.txt
pip_b.3.txt
pip_b.3mmm.txt

bennato:

bennato/peterpan:
123.txt

consoli:
pip_a.12.txt

daniele:

daniele/anna:
abc.txt

procuces

batiato/giubbe:
pip_b.2.txt
pip_b.3.txt
pip_b.3mmm.txt

bennato/peterpan:
123.txt

consoli:
pip_a.12.txt

daniele/anna:
abc.txt

I would imagine something like:
"if a line containing ":" is followed by an empty line delete both lines (the line with ":" and the empty line)"
i.e. something like in general
if a line containing regex1 is followed (immediately after) by a line containing regex2 delete both lines.

if it would be on one line I would do: sed '/regex1.*regex2/d' -->
how to spread this command on 2 lines? And consider hat in my case regex2 is an empty line ( i.e. ^$).

thanks

oh yes! this works now!
Thanks a lot and thanks for the explanation too

Sorry, I posted my first reply based on a too cursory reading of your question.

sed '/:$/!b;N;/:\n$/d' input.txt

Here's a brief explanation:

/:$/!b - if not a line ending with a colon, just skip to the end of the script and print.
N - this is a line ending with a colon; fetch the next line and glue them together.
/:\n$/d - if the combined two lines match this pattern, delete
else, print

The \n thing works differently in different versions of sed, but if it doesn't work, try with a literal newline, with or without a backslash.