a SED question

Hi, all

I want to print a paragraph if it contains AAA (blank lines separate paragraphs)
So I tired the following one :
sed -e '/./{H;$!d;}' -e 'x;/AAA/!d;' InputFile

It gives out all the paragraph contains AAA in InputFile. Is there anything wrong with this statement? Could anyone suggest a way of outputing one paragraph at a time?

Thanks,

You want only with sed command or even grep is ok.

We can do this by grep also like this

grep "AAA" <file_name> | head -1 ( It will give only first one ).