title: Vim: open a new buffer containing all the lines of the current file matching a pattern
body: <p>I am editing a Python file in Vim and I have a few lines to extract: all lines matching pattern <code>REGEX</code>.</p>
  
  <p>I can list all of these lines by <code>:g/REGEX</code>.</p>
  
  <p>How can I open a new buffer with the contents of the selection returned by the command above?</p>
  
  <p>Right now, I am resorting to exiting the editor and using <code>cat</code> and <code>grep</code> to actually create a new file... there must be an integrated way?</p>