Try:
sed -e '/^a1$/,+1d' "filename"
This means from /^a1$/ to the next line, delete
The ^ and $ ensure you match the whole line, so a hidden a1 will not be matched.
Try:
sed -e '/^a1$/,+1d' "filename"
This means from /^a1$/ to the next line, delete
The ^ and $ ensure you match the whole line, so a hidden a1 will not be matched.