<?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>the tar pit &#187; regex</title>
	<atom:link href="http://blog.goneopen.com/tag/regex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.goneopen.com</link>
	<description>Thrashing around in the stickiness of software</description>
	<lastBuildDate>Mon, 09 Jan 2012 23:35:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Regex in Find-and-replace in Visual Studio for left-angle brackets</title>
		<link>http://blog.goneopen.com/2009/07/regex-in-find-and-replace-in-visual-studio-for-left-angle-brackets/</link>
		<comments>http://blog.goneopen.com/2009/07/regex-in-find-and-replace-in-visual-studio-for-left-angle-brackets/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 23:18:42 +0000</pubDate>
		<dc:creator>todd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[aspnet]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://blog.goneopen.com/2009/07/regex-in-find-and-replace-in-visual-studio-for-left-angle-brackets/</guid>
		<description><![CDATA[My problem is simple. Sandcastle requires encoded html to parse correctly. Having generics in the documentation causes it to break. I need to replace the '&#60;' with &#38;lt;. I just now need to do this by the solution in Visual Studio. Of course, microsoft requires me to know another regex set of expresssions: http://msdn.microsoft.com/en-us/library/2k3te2cs(VS.80).aspx Here&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>My problem is simple. Sandcastle requires encoded html to parse correctly. Having generics in the documentation causes it to break. I need to replace the <code>'&lt;'</code> with <code>&amp;lt;</code>. I just now need to do this by the solution in Visual Studio. Of course, microsoft requires me to know another regex set of expresssions: http://msdn.microsoft.com/en-us/library/2k3te2cs(VS.80).aspx</p>

<p>Here&#8217;s the simple regex: </p>


<ul>
<li><strong>Find:</strong> <code>///{.*}{[^:b\&gt;\.]}(\&lt;)</code></li>
<li><strong>Replace:</strong> <code>///&amp;lt;</code></li>
</ul>



<p>The regex looks for a left angle bracket on the end of a word (ie no space, no period). This means that it also leaves html in place.</p>

<p><img src="../../../wp-content/uploads/2009/07/find-and-replace-regex.png" alt="Find and Replace in Visual Studio 2008" /></p>

<p><strong>Note:</strong> I wouldn&#8217;t do a global replace but use it to step through each. </p>

<h2>Before:</h2>



<pre>
    /// &lt;summary&gt;
    /// Used for testing the redirection of action on successful and failing calls to an action.   
    /// &lt;example&gt;
    ///    [TestClass]
    ///    public class UserControllerRedirectsTest
    ///    {
    ///        [TestMethod]
    ///        public void SuccessfulCreateRedirectsToIndex()
    ///        {
    ///            Controller&lt;UserController&gt;
    ///                .ShouldRedirectTo(ResfulAction.Index)
    ///                .IfCallSucceeds()
    ///                .WhenCalling(x =&gt; x.Create(null));
    /// &lt;/example&gt;
    /// &lt;/summary&gt;
    /// &lt;typeparam name=&quot;T&quot;&gt;&lt;/typeparam&gt;
</pre>



<h2>After:</h2>



<pre>
    /// &lt;summary&gt;
    /// Used for testing the redirection of action on successful and failing calls to an action.   
    /// &lt;example&gt;
    ///    [TestClass]
    ///    public class UserControllerRedirectsTest
    ///    {
    ///        [TestMethod]
    ///        public void SuccessfulCreateRedirectsToIndex()
    ///        {
    ///            Controller&amp;lt;UserController&gt;
    ///                .ShouldRedirectTo(ResfulAction.Index)
    ///                .IfCallSucceeds()
    ///                .WhenCalling(x =&gt; x.Create(null));
    /// &lt;/example&gt;
    /// &lt;/summary&gt;
    /// &lt;typeparam name=&quot;T&quot;&gt;&lt;/typeparam&gt;
</pre>]]></content:encoded>
			<wfw:commentRss>http://blog.goneopen.com/2009/07/regex-in-find-and-replace-in-visual-studio-for-left-angle-brackets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

