In Emacs how can I easily copy all lines matching a particular regex? Preferably highlighting the matching lines as I type.
occur gets partway there by
occur
You can use keep-lines to get what you want, copy them, and then undo. For the opposite, there is also flush-lines to get rid of lines you don't want.
keep-lines
flush-lines