<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: TextMate Tip – Find and Replace</title>
	<atom:link href="http://ciaranwal.sh/2007/11/13/textmate-tip-find-and-replace/feed" rel="self" type="application/rss+xml" />
	<link>http://ciaranwal.sh/2007/11/13/textmate-tip-find-and-replace</link>
	<description></description>
	<lastBuildDate>Thu, 29 Jul 2010 16:27:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Annie Niemoose</title>
		<link>http://ciaranwal.sh/2007/11/13/textmate-tip-find-and-replace/comment-page-1#comment-39054</link>
		<dc:creator>Annie Niemoose</dc:creator>
		<pubDate>Tue, 18 Aug 2009 17:10:47 +0000</pubDate>
		<guid isPermaLink="false">http://ciaranwal.sh/2007/11/09/textmate-tip-%e2%80%93-find-and-replace#comment-39054</guid>
		<description>&lt;p&gt;What&#039;s the easiest way to do a find and iterative replace in TextMate?  I find I often have the problem where I&#039;d like to find every result matching an expression and replace them from a list of values in my clipboard or in another file.  Let&#039;s say you have a hundred expressions in the form of:&lt;/p&gt;

&lt;p&gt;INSERT INTO price&lt;em&gt;change (id, product&lt;/em&gt;id, new&lt;em&gt;price, start&lt;/em&gt;date) VALUES (1, 12345, &#039;34.99&#039;, sysdate + 15);
INSERT INTO price&lt;em&gt;change (id, product&lt;/em&gt;id, new&lt;em&gt;price, start&lt;/em&gt;date) VALUES (2, 23238, &#039;37.99&#039;, sysdate + 20);
...&lt;/p&gt;

&lt;p&gt;and you have a list of a hundred product IDs that you&#039;d like swap into those statements.  It&#039;d be neat if there was a simple way to do a find/replace on (&#092;(&#092;d+, )&#092;d+, to replace with $1$product&lt;em&gt;id,  where each time it used the next product ID instead of $product&lt;/em&gt;id.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>What&#8217;s the easiest way to do a find and iterative replace in TextMate?  I find I often have the problem where I&#8217;d like to find every result matching an expression and replace them from a list of values in my clipboard or in another file.  Let&#8217;s say you have a hundred expressions in the form of:</p>

<p>INSERT INTO price<em>change (id, product</em>id, new<em>price, start</em>date) VALUES (1, 12345, &#8217;34.99&#8242;, sysdate + 15);
INSERT INTO price<em>change (id, product</em>id, new<em>price, start</em>date) VALUES (2, 23238, &#8217;37.99&#8242;, sysdate + 20);
&#8230;</p>

<p>and you have a list of a hundred product IDs that you&#8217;d like swap into those statements.  It&#8217;d be neat if there was a simple way to do a find/replace on (&#92;(&#92;d+, )&#92;d+, to replace with $1$product<em>id,  where each time it used the next product ID instead of $product</em>id.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: julian</title>
		<link>http://ciaranwal.sh/2007/11/13/textmate-tip-find-and-replace/comment-page-1#comment-31647</link>
		<dc:creator>julian</dc:creator>
		<pubDate>Thu, 05 Mar 2009 21:21:28 +0000</pubDate>
		<guid isPermaLink="false">http://ciaranwal.sh/2007/11/09/textmate-tip-%e2%80%93-find-and-replace#comment-31647</guid>
		<description>&lt;p&gt;sorry - the tags have been mangled in the above comment - not quite sure how to fix it as there is no preview option.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>sorry &#8211; the tags have been mangled in the above comment &#8211; not quite sure how to fix it as there is no preview option.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: julian</title>
		<link>http://ciaranwal.sh/2007/11/13/textmate-tip-find-and-replace/comment-page-1#comment-31646</link>
		<dc:creator>julian</dc:creator>
		<pubDate>Thu, 05 Mar 2009 21:17:23 +0000</pubDate>
		<guid isPermaLink="false">http://ciaranwal.sh/2007/11/09/textmate-tip-%e2%80%93-find-and-replace#comment-31646</guid>
		<description>&lt;p&gt;Josh, if you want to replace tags you can use a regular expression&lt;/p&gt;

&lt;p&gt;In the find box type 
&lt;my&lt;em&gt;tag&gt;.+&lt;/my&lt;/em&gt;tag&gt;
In the replace box type whatever you want to replace it with .. for example
&lt;my&lt;em&gt;new&lt;/em&gt;tag&gt;hello&lt;/my&lt;em&gt;new&lt;/em&gt;tag&gt;
check the &quot;Regular Expression&quot; checkbox&lt;/p&gt;

&lt;p&gt;The . means any character, and the + means 1 or more of them - so .+ means any string with at least one character. If you want to match zero or more, use * instead of +&lt;/p&gt;

&lt;p&gt;You can also use part of the matched search in the replacement. You do this by placing () around each part of the search you want to use, and referring to them in the replacement with $1, $2 etc. For example, suppose you have months and years in date tags january 1992  march 2003 etc., but instead you want:

is the month
is the year
&lt;/p&gt;

&lt;p&gt;You can do it like this:
In the search field:
([A-Z,a-z]+) ([1-2][0-9][0-9][0-9])
In the replace field:
&#092;nis the month&#092;nis the year&#092;n&lt;/p&gt;

&lt;p&gt;As mentioned, the brackets store the matches in variables: $1 and $2  based on the order of the bracket groups.
[A-Z,a-z]+ means 1 or more upper or lower case characters
[1-2][0-9][0-9][0-9] means 4 digits, the first must be 1 or 2
&#092;n prints a new line&lt;/p&gt;

&lt;p&gt;hope it helps&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Josh, if you want to replace tags you can use a regular expression</p>

<p>In the find box type 
&lt;my<em>tag&gt;.+&lt;/my</em>tag&gt;
In the replace box type whatever you want to replace it with .. for example
&lt;my<em>new</em>tag&gt;hello&lt;/my<em>new</em>tag&gt;
check the &#8220;Regular Expression&#8221; checkbox</p>

<p>The . means any character, and the + means 1 or more of them &#8211; so .+ means any string with at least one character. If you want to match zero or more, use * instead of +</p>

<p>You can also use part of the matched search in the replacement. You do this by placing () around each part of the search you want to use, and referring to them in the replacement with $1, $2 etc. For example, suppose you have months and years in date tags january 1992  march 2003 etc., but instead you want:

is the month
is the year
</p>

<p>You can do it like this:
In the search field:
([A-Z,a-z]+) ([1-2][0-9][0-9][0-9])
In the replace field:
&#92;nis the month&#92;nis the year&#92;n</p>

<p>As mentioned, the brackets store the matches in variables: $1 and $2  based on the order of the bracket groups.
[A-Z,a-z]+ means 1 or more upper or lower case characters
[1-2][0-9][0-9][0-9] means 4 digits, the first must be 1 or 2
&#92;n prints a new line</p>

<p>hope it helps</p>]]></content:encoded>
	</item>
	<item>
		<title>By: cosmetic dentist</title>
		<link>http://ciaranwal.sh/2007/11/13/textmate-tip-find-and-replace/comment-page-1#comment-30730</link>
		<dc:creator>cosmetic dentist</dc:creator>
		<pubDate>Wed, 28 Jan 2009 15:29:13 +0000</pubDate>
		<guid isPermaLink="false">http://ciaranwal.sh/2007/11/09/textmate-tip-%e2%80%93-find-and-replace#comment-30730</guid>
		<description>&lt;p&gt;Hi how do we do aglobal find an replace acorss 1000 files ive tried it and it works for open fiels but is there any way of doing this accross an entire website?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi how do we do aglobal find an replace acorss 1000 files ive tried it and it works for open fiels but is there any way of doing this accross an entire website?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ciarán</title>
		<link>http://ciaranwal.sh/2007/11/13/textmate-tip-find-and-replace/comment-page-1#comment-29306</link>
		<dc:creator>Ciarán</dc:creator>
		<pubDate>Wed, 17 Dec 2008 20:03:34 +0000</pubDate>
		<guid isPermaLink="false">http://ciaranwal.sh/2007/11/09/textmate-tip-%e2%80%93-find-and-replace#comment-29306</guid>
		<description>&lt;p&gt;Hi Josh,
I suggest you ask in the IRC channel (##textmate on freenode), or post a more detailed description of your problem to the mailing list.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Josh,
I suggest you ask in the IRC channel (##textmate on freenode), or post a more detailed description of your problem to the mailing list.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://ciaranwal.sh/2007/11/13/textmate-tip-find-and-replace/comment-page-1#comment-29305</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Wed, 17 Dec 2008 20:01:15 +0000</pubDate>
		<guid isPermaLink="false">http://ciaranwal.sh/2007/11/09/textmate-tip-%e2%80%93-find-and-replace#comment-29305</guid>
		<description>&lt;p&gt;Do you know of a find and replace, where you can replace a certain tag, and anything within that tag, with something else? I have a XML document and i need to delete some extraneous tags but don;t want to go through line by line and do it.&lt;/p&gt;

&lt;p&gt;Any suggestions??&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Do you know of a find and replace, where you can replace a certain tag, and anything within that tag, with something else? I have a XML document and i need to delete some extraneous tags but don;t want to go through line by line and do it.</p>

<p>Any suggestions??</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ruby, Rails, TextMate</title>
		<link>http://ciaranwal.sh/2007/11/13/textmate-tip-find-and-replace/comment-page-1#comment-1283</link>
		<dc:creator>Ruby, Rails, TextMate</dc:creator>
		<pubDate>Fri, 04 Jan 2008 03:32:39 +0000</pubDate>
		<guid isPermaLink="false">http://ciaranwal.sh/2007/11/09/textmate-tip-%e2%80%93-find-and-replace#comment-1283</guid>
		<description>&lt;p&gt;[...] Tips and Tricks - Find and Replace [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] Tips and Tricks &#8211; Find and Replace [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ruby, Rails, TextMate &#171; exceptionz</title>
		<link>http://ciaranwal.sh/2007/11/13/textmate-tip-find-and-replace/comment-page-1#comment-752</link>
		<dc:creator>Ruby, Rails, TextMate &#171; exceptionz</dc:creator>
		<pubDate>Mon, 10 Dec 2007 10:28:14 +0000</pubDate>
		<guid isPermaLink="false">http://ciaranwal.sh/2007/11/09/textmate-tip-%e2%80%93-find-and-replace#comment-752</guid>
		<description>&lt;p&gt;[...] Tips and Tricks - Find and Replace [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] Tips and Tricks &#8211; Find and Replace [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Henshaw</title>
		<link>http://ciaranwal.sh/2007/11/13/textmate-tip-find-and-replace/comment-page-1#comment-303</link>
		<dc:creator>Jon Henshaw</dc:creator>
		<pubDate>Wed, 14 Nov 2007 06:04:42 +0000</pubDate>
		<guid isPermaLink="false">http://ciaranwal.sh/2007/11/09/textmate-tip-%e2%80%93-find-and-replace#comment-303</guid>
		<description>&lt;p&gt;If you get a chance, you should check out the &lt;a href=&quot;http://snipplr.com/extras/textmate/&quot; rel=&quot;nofollow&quot;&gt;Snipplr TextMate bundle&lt;/a&gt; – it seems like the perfect fodder for an entry on your blog.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If you get a chance, you should check out the <a href="http://snipplr.com/extras/textmate/" rel="nofollow">Snipplr TextMate bundle</a> – it seems like the perfect fodder for an entry on your blog.</p>]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->