M-x occur provides a buffer containing a list of the matches of a string in the current buffer.

M-x occur provides a buffer containing a list of the matches of a string in the current buffer.