I have 12+GB sql file. It has been created using --all-databases option of MySQL. I was able to open it in Vi via Cygwin in Windows. This sql file contains multiple database blocks. The common pattern repeating between the blocks is
--
-- Current Database: `database_name`
--
What I would like to do is to select all between
--
-- Current Database: `database_name`
--
and DELETE them. How can I do that in Vi using Regex?
:%s/--\s\+--\s\+Current Database: `database_name`\s\+--[^-]*\(-\(-\s\+--\s\+Current Database: `database_name`\s\+--\)\@![^-]*\)*--\s\+--\s\+Current Database: `database_name`\s\+--//g
.