{"id":1405,"date":"2009-04-21T10:17:52","date_gmt":"2009-04-21T09:17:52","guid":{"rendered":"http:\/\/cocaman.ch\/wp\/?p=1405"},"modified":"2009-04-21T10:17:52","modified_gmt":"2009-04-21T09:17:52","slug":"vim-regex-search-and-delete-line","status":"publish","type":"post","link":"https:\/\/cocaman.ch\/wp\/2009\/04\/vim-regex-search-and-delete-line\/","title":{"rendered":"vim: Regex Search and Delete Line"},"content":{"rendered":"<blockquote><p>:%g!\/\\< \\(STRING\\|VALUE\\)\\>\/d<\/p><\/blockquote>\n<p><strong>Explanation<\/strong><br \/>\n<em>:%g<\/em> Range to search. %g means the complete file<br \/>\n<em>!<\/em> Negotiation. Can be used to negate the regex<br \/>\n<em>\\< \\(STRING\\|VALUE\\)\\<\/em> regular expression (regex). Can be anything<br \/>\n<\/em><em>\/d<\/em> command to execute with each line found. d means delete<\/p>\n<p><strong>Example used<\/strong><br \/>\n:%g\/INSERT INTO `table` VALUES>\/d<\/p>\n<p>This command deletes ALL lines with <em>INSERT INTO  `table` VALUES<\/em> from the current file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>:%g!\/\\< \\(STRING\\|VALUE\\)\\>\/d Explanation :%g Range to search. %g means the complete file ! Negotiation. Can be used to negate the regex \\< \\(STRING\\|VALUE\\)\\ regular expression (regex). Can be anything \/d command to execute with each line found. d means delete Example used :%g\/INSERT INTO `table` VALUES>\/d This command deletes ALL lines with INSERT INTO `table` [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[746],"tags":[1033,85,808,1031,1032,1030],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4tJa-mF","_links":{"self":[{"href":"https:\/\/cocaman.ch\/wp\/wp-json\/wp\/v2\/posts\/1405"}],"collection":[{"href":"https:\/\/cocaman.ch\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cocaman.ch\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cocaman.ch\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cocaman.ch\/wp\/wp-json\/wp\/v2\/comments?post=1405"}],"version-history":[{"count":6,"href":"https:\/\/cocaman.ch\/wp\/wp-json\/wp\/v2\/posts\/1405\/revisions"}],"predecessor-version":[{"id":1411,"href":"https:\/\/cocaman.ch\/wp\/wp-json\/wp\/v2\/posts\/1405\/revisions\/1411"}],"wp:attachment":[{"href":"https:\/\/cocaman.ch\/wp\/wp-json\/wp\/v2\/media?parent=1405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cocaman.ch\/wp\/wp-json\/wp\/v2\/categories?post=1405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cocaman.ch\/wp\/wp-json\/wp\/v2\/tags?post=1405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}