I know Delete all lines matching a pattern.
:g/pattern/d
and yank to register (Copy all lines matching a pattern to register \'a\'.)