grep the pattern followed by newline

Hi
I have a problem using grep to find a pattern followed by newline.
Here is my file

xxxxxxxxxxxpattern
patternxxxxxx
pattern
xxxpattern
xxpatternx
xxxxxxyyyyxxxx

I want the result to be like this

xxxxxxxxxxxpattern
pattern
xxxpattern

Please help

Just add a '$' at the end of your pattern to match the end of the line:

grep "pattern$"

Thanks a lot that works