<?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>FlexOOP &#187; Eclipse</title>
	<atom:link href="http://flexoop.com/tag/eclipse/feed/" rel="self" type="application/rss+xml" />
	<link>http://flexoop.com</link>
	<description>Flex, AIR, ColdFusion, and everything in between</description>
	<lastBuildDate>Tue, 13 Jul 2010 03:56:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Subclipse 1.6 changes highlight and comment colors in CFEclipse</title>
		<link>http://flexoop.com/2009/04/subclipse-16-changes-highlight-and-comment-colors-in-cfeclipse/</link>
		<comments>http://flexoop.com/2009/04/subclipse-16-changes-highlight-and-comment-colors-in-cfeclipse/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 14:06:41 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[CFEclipse]]></category>
		<category><![CDATA[Subclipse]]></category>

		<guid isPermaLink="false">http://flexoop.com/?p=164</guid>
		<description><![CDATA[I just installed Subclipse 1.6 in my Flex Builder as there was some conflict between it and my TortoiseSVN install. I like to do my commits and updates via Eclipse so I&#8217;m not switching out to my Explorer window for quick commits. If there is any conflict resolution needed, or I need a little more [...]]]></description>
			<content:encoded><![CDATA[<p>I just installed Subclipse 1.6 in my Flex Builder as there was some conflict between it and my TortoiseSVN install.  I like to do my commits and updates via Eclipse so I&#8217;m not switching out to my Explorer window for quick commits.  If there is any conflict resolution needed, or I need a little more fine grained control, I switch out to Tortoise (as Subclipse doesn&#8217;t do as good a job currently).</p>
<p>After I upgraded from Subclipse 1.4 to 1.6, for some reason (I pretty sure it was Subclipse as I didn&#8217;t upgrade anything else), it decided that it didn&#8217;t like my comment color in CFEclipse or my highlight color and decided to randomly alter those colors to something else&#8230;a really weird, dark green for the comment background color and a much darker shade of blue for the text highlight color.  To my mild case of OCD, that is just unacceptable <img src='http://flexoop.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Plus it&#8217;s just really difficult to read *any* text with a dark green background</p>
<p>If you want to switch these options back to their original colors, do the following:<br />
Window -> Preferences -> CFEclipse -> Editor -> CFML Colours -> CFML Comment Background<br />
I switched this one back to white from dark green.<br />
and<br />
Window -> Preferences -> CFEclipse -> Editor -> Appearance color options -> Selection background color<br />
This one I had to create a new custom color and set it to Red 49, Green 106, and Blue 197 (this, I think, is the windows highlight color).</p>
<p>So far these are the only things I&#8217;ve found that it changes.  I&#8217;ll post new updates if I find anything else.</p>
]]></content:encoded>
			<wfw:commentRss>http://flexoop.com/2009/04/subclipse-16-changes-highlight-and-comment-colors-in-cfeclipse/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Success! Fixing the ja_JP locale from being set in compiler arguments</title>
		<link>http://flexoop.com/2009/01/success-fixing-the-ja_jp-locale-from-being-set-in-compiler-arguments/</link>
		<comments>http://flexoop.com/2009/01/success-fixing-the-ja_jp-locale-from-being-set-in-compiler-arguments/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 03:41:37 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[locale]]></category>

		<guid isPermaLink="false">http://flexoop.com/?p=145</guid>
		<description><![CDATA[Ha ha! I figured out (after just blogging my frustration in my previous post) how to change the Additional compiler arguments that automatically are added when creating a new project from ja_JP to en_US. There is a file called config.xml (on my PC it is located in C:\Program Files\Adobe\Flex Builder 3 Plug-in\eclipse\plugins\com.adobe.flexbuilder.flex_3.0.214193) that gets installed [...]]]></description>
			<content:encoded><![CDATA[<p>Ha ha!  I figured out (after just blogging my frustration in <a href="/2009/01/why-is-locale-set-to-ja_jp/">my previous post</a>) how to change the Additional compiler arguments that automatically are added when creating a new project from ja_JP to en_US.</p>
<p>There is a file called config.xml (on my PC it is located in C:\Program Files\Adobe\Flex Builder 3 Plug-in\eclipse\plugins\com.adobe.flexbuilder.flex_3.0.214193) that gets installed when updating via the Adobe updater.  I&#8217;m not quite sure what happened, but it decided that my compiler arguments should be set to ja_JP.  In order to fix this problem, just change this line from</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;locale<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ja_JP<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/locale<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>to</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;locale<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>en_US<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/locale<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>This will now add en_US as an additional compiler argument instead of ja_JP.  Now I can get back to coding again <img src='http://flexoop.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://flexoop.com/2009/01/success-fixing-the-ja_jp-locale-from-being-set-in-compiler-arguments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Regular Expressions to build ColdFusion getters and setters</title>
		<link>http://flexoop.com/2008/11/using-regular-expressions-to-build-coldfusion-getters-and-setters/</link>
		<comments>http://flexoop.com/2008/11/using-regular-expressions-to-build-coldfusion-getters-and-setters/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 03:30:30 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Regular Expressions]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[RegEx]]></category>
		<category><![CDATA[Regular Expression]]></category>

		<guid isPermaLink="false">http://flexfusion.archfamily.com/?p=39</guid>
		<description><![CDATA[I&#8217;m always looking for ways to make my life a little easier when writing code, and to take the monotony out of the equation wherever I can.  I know there is lots of back-and-forth about whether this method should or should not be used in ColdFusion, but I feel that for the minor incovenience of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m always looking for ways to make my life a little easier when writing code, and to take the monotony out of the equation wherever I can.  I know there is lots of back-and-forth about whether this method should or should not be used in ColdFusion, but I feel that for the minor incovenience of running a reg ex, creating getters and setters in my CFCs/Objects just make sense if just for the very fact of encapsulation.  Plus if you need to alter anything that occurs during a &#8220;set&#8221; operation, nothing outside of the object is broken when you make the change within your object.  Anyway, back to business:</p>
<p>This regular expression can be used in Eclipse (my current IDE) and will convert something that looks like:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> variables.firstName <span style="color: #0000FF;">=</span> <span style="color: #009900;">&quot;&quot;</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> variables.lastName <span style="color: #0000FF;">=</span> <span style="color: #009900;">&quot;&quot;</span> <span style="color: #0000FF;">/&gt;</span></span></pre></div></div>

<p>into</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cffunction</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;getfirstName&quot;</span> output<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;false&quot;</span> <span style="color: #0000FF;">access</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;public&quot;</span> returntype<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;any&quot;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfreturn</span> variables.firstName <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cffunction</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cffunction</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;setfirstName&quot;</span> output<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;false&quot;</span> <span style="color: #0000FF;">access</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;public&quot;</span> returntype<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;void&quot;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfargument</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;val&quot;</span> <span style="color: #0000FF;">required</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> variables.firstName <span style="color: #0000FF;">=</span> arguments.<span style="color: #0000FF;">val</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cffunction</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>The search string is:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> variables.<span style="color: #0000FF;">&#40;</span>\w+<span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">=</span>  <span style="color: #0000FF;">&#91;</span>^<span style="color: #0000FF;">&gt;</span></span>]+&gt;(\r\n)(\t)</pre></div></div>

<p>and the replace string is:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cffunction</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;get$1&quot;</span> output<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;false&quot;</span>  <span style="color: #0000FF;">access</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;public&quot;</span> returntype<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;any&quot;</span><span style="color: #0000FF;">&gt;</span></span>$2$3$3<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfreturn</span> variables.$1  <span style="color: #0000FF;">/&gt;</span></span>$2$3<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cffunction</span><span style="color: #0000FF;">&gt;</span></span>$2$2$3<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cffunction</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;set$1&quot;</span> output<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;false&quot;</span>  <span style="color: #0000FF;">access</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;public&quot;</span> returntype<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;void&quot;</span><span style="color: #0000FF;">&gt;</span></span>$2$3$3<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfargument</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;val&quot;</span>  <span style="color: #0000FF;">required</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000FF;">/&gt;</span></span>$2$3$3<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> variables.$1 <span style="color: #0000FF;">=</span> arguments.<span style="color: #0000FF;">val</span>  <span style="color: #0000FF;">/&gt;</span></span>$2$3<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cffunction</span><span style="color: #0000FF;">&gt;</span></span>$2$2$</pre></div></div>

<p>The search string contains a &#8220;tab&#8221; character at the end.  This is really just so I can format the output of the getters and setters, but feel free to modify them however you wish.</p>
]]></content:encoded>
			<wfw:commentRss>http://flexoop.com/2008/11/using-regular-expressions-to-build-coldfusion-getters-and-setters/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding space before and after parentheses</title>
		<link>http://flexoop.com/2008/05/adding-space-before-and-after-parentheses/</link>
		<comments>http://flexoop.com/2008/05/adding-space-before-and-after-parentheses/#comments</comments>
		<pubDate>Thu, 22 May 2008 18:22:53 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Errors]]></category>
		<category><![CDATA[Regular Expressions]]></category>

		<guid isPermaLink="false">http://flexfusion.archfamily.com/?p=16</guid>
		<description><![CDATA[I had previously written a regular expression that adds extra space within parentheses, so (test) would become ( test ). However, this gets more complex the more parentheses that are added to the mix. ((test)) and (((test))) require a much more complex regex statement to work correctly (and find the correct ending parenthesis to match [...]]]></description>
			<content:encoded><![CDATA[<p>I had previously written a regular expression that adds extra space within parentheses, so (test) would become ( test ).  However, this gets more complex the more parentheses that are added to the mix.  ((test)) and (((test))) require a much more complex regex statement to work correctly (and find the correct ending parenthesis to match up with the correct starting parenthesis).</p>
<p>I was rethinking how I did this and came up with a new method.  The only difference is that this test will need to be run twice, once for the opening parenthesis and once for the closing parenthesis.  As I usually just do a &#8220;Replace All&#8221;, I figured it wasn&#8217;t that much more difficult than doing it the old way (plus this will work for a much parenthesis nesting as a user puts in).</p>
<p>The Regular Expression is:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">Find: \<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>?<span style="color: #66cc66;">!</span> <span style="color: #66cc66;">|</span>\<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
Replace: <span style="color: #ff0000;">&quot;( &quot;</span></pre></div></div>

<p>remove the double quotes first&#8230;I just wanted to make the space visible.</p>
<p>This regular expression means:<br />
Find an opening parenthesis</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">\<span style="color: #66cc66;">&#40;</span></pre></div></div>

<p>Then check the next character (but do not include/consume it in the &#8220;find&#8221;).  If it is not a space or a closing parenthesis, match the statement</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>?<span style="color: #66cc66;">!</span> <span style="color: #66cc66;">|</span>\<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>This will work on something like:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>which, after the first run, becomes</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span> test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Then the second Regular Expression would be:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">Find: <span style="color: #66cc66;">&#40;</span>?<span style="color: #66cc66;">&lt;!</span> <span style="color: #66cc66;">|</span>\<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>\<span style="color: #66cc66;">&#41;</span>
Replace: <span style="color: #ff0000;">&quot; )&quot;</span></pre></div></div>

<p>remove the double quotes first&#8230;I just wanted to make the space visible.</p>
<p>This regular expression means (starting from the right this time):<br />
Find a closing parenthesis</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">\<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Then check the <em>previous</em> character (but don&#8217;t include/consume it in the &#8220;find&#8221;).  If it is not a space or opening parenthesis, match the statement.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>?<span style="color: #66cc66;">&lt;!</span> <span style="color: #66cc66;">|</span>\<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>This will take the previous finished example of:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span> test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>and change it to:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span> test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>By adding the extra space to my code, I think it makes everything a little bit easier to read.  This will work for any type of brackets (or any character for that matter).  In the first find statement, you can replace the parenthesis in \) and \( with \[ or \] or whatever you want.  The same goes for the second find statement.  I don&#8217;t know why I didn&#8217;t think of doing it this way before instead of trying to figure out how to code a really long match for the opening and closing parentheses.  It will definitely make my life easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://flexoop.com/2008/05/adding-space-before-and-after-parentheses/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Regular Expressions are fun!</title>
		<link>http://flexoop.com/2008/04/regular-expressions-are-fun/</link>
		<comments>http://flexoop.com/2008/04/regular-expressions-are-fun/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 18:10:41 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Regular Expressions]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[RegEx]]></category>

		<guid isPermaLink="false">http://flexfusion.archfamily.com/?p=13</guid>
		<description><![CDATA[Whenever I&#8217;m coding I like things just so I&#8217;m pretty sure it&#8217;s a very mild case of OCD as it really does bug me when things are different. Not so much that I get any kind of other disorders from this, but enough that I want to go in and make my changes/fixes to put [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever I&#8217;m coding I like things <em>just</em> so <img src='http://flexoop.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   I&#8217;m pretty sure it&#8217;s a very mild case of <a href="http://en.wikipedia.org/wiki/Obsessive-compulsive_disorder" target="_blank">OCD</a> as it really does bug me when things are different.  Not so much that I get any kind of <em>other</em> disorders from this, but enough that I want to go in and make my changes/fixes to put in the way I like it.  In order to help me through this, I have started writing many regular expressions that will fix the code, and hopefully be quicker than manually editing the pages.</p>
<p>My company has come up with a set of standards that we&#8217;re trying to follow when writing our code, so, if anyone else joins the company and edits/creates new code they can just follow the guidelines we already have set up.  In order to keep track of all of the regular expressions I&#8217;m writing (and so others can use them if they wish), I&#8217;ve created a <a href="http://flexfusion.archfamily.com/regular-expressions/">Regular Expressions page</a> that I&#8217;ll periodically be updating with new regular expressions each time I use them.  I know they&#8217;re useful to me, so I&#8217;m sure that at least one other person will have a use for them too <img src='http://flexoop.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://flexoop.com/2008/04/regular-expressions-are-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regular Expressions in Flex Builder</title>
		<link>http://flexoop.com/2008/04/regular-expressions-in-flex-builder/</link>
		<comments>http://flexoop.com/2008/04/regular-expressions-in-flex-builder/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 01:54:22 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[RegEx]]></category>
		<category><![CDATA[Regular Expression]]></category>

		<guid isPermaLink="false">http://flexfusion.archfamily.com/?p=12</guid>
		<description><![CDATA[Up until a couple of months ago, I had not really used the regular expression Find/Replace in Eclipse. I&#8217;d read several blog posts about it, but hadn&#8217;t really played around with it much. This all changed after I was, once again, manually replacing some items in Eclipse (setting multiple properties of an object to those [...]]]></description>
			<content:encoded><![CDATA[<p>Up until a couple of months ago, I had not really used the regular expression Find/Replace in Eclipse. I&#8217;d read several blog posts about it, but hadn&#8217;t really played around with it much. This all changed after I was, once again, manually replacing some items in Eclipse (setting multiple properties of an object to those of an item that had been passed in to the function). About halfway through, I figured I would try using regular expressions to automate the task a bit.  From this point on, just about every find/replace I did was using a regular expression.</p>
<p>All of these examples are for ActionScript, by the way, but could easily be converted to be useful in any other programming language:</p>
<p>For example: <b>(Make sure to remove the double quotes from these examples also.</b>)</p>
<p>I prefer curly braces in my functions to be on the same line as the actual function definition rather than on the next line so I wrote this</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">Find: <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\s</span>+<span style="color: #000099; font-weight: bold;">\{</span>&quot;</span>
Replace: <span style="color: #ff0000;">&quot; {&quot;</span></pre></div></div>

<p>This will take something like:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> testing<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span></pre></div></div>

<p>and change it to</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> testing<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></pre></div></div>

<p>Not a huge deal to most, but my code OCD <img src='http://flexoop.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  and our in-house coding standards like it on the same line. If I don&#8217;t have to manually do this, it certainly makes things easier.</p>
<p>Now this isn&#8217;t that complex and in most other IDE&#8217;s could be handled pretty easily. However, try doing something like this next example without using some kind of regular expression <img src='http://flexoop.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>(This example is pretty long, so make sure to remove the carriage return before the &#8220;return this&#8221; statement when pasting into your Replace field)</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">Find: <span style="color: #ff0000;">&quot;public var (<span style="color: #000099; font-weight: bold;">\w</span>+):( )?(<span style="color: #000099; font-weight: bold;">\w</span>+)( ?= ?[^;]+)?;(([^<span style="color: #000099; font-weight: bold;">\t</span>])+(<span style="color: #000099; font-weight: bold;">\t</span>)(<span style="color: #000099; font-weight: bold;">\t</span>+)?(<span style="color: #000099; font-weight: bold;">\s</span>+)?)&quot;</span>
Replace: <span style="color: #ff0000;">&quot;private var _$1:$3$4;$5$5public function get $1():$3 {$5$7
return this._$1;$5}$5$5 public function set $1( value:$3 ):void {$5$7this._$1 = value;$5}$5$5&quot;</span></pre></div></div>

<p>This example will take something like:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> companyId:uint;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> companyName:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> isLegit:<span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;</pre></div></div>

<p>Will be converted to multiple accessors (i.e.setters and getters). I won&#8217;t show all 3, but this is what the first one would be converted to:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _companyId:uint;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> companyId<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:uint <span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>._companyId;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> companyId<span style="color: #66cc66;">&#40;</span> value:uint <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">this</span>._companyId = value;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>That has saved me so much coding time.</p>
<p>Anyway, I wish I had started using these earlier as I&#8217;m now setting up a nice little library of scripts that I can run whenever I need to modify my code. I&#8217;m sure someone has set up a site with a library of these things, but these are just a few that I&#8217;ve set up.</p>
<p>And one very important thing to remember with these:</p>
<p><b>Make sure to check the Regular Expressions checkbox in Find/Replace</b> or it will probably never find anything <img src='http://flexoop.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://flexoop.com/2008/04/regular-expressions-in-flex-builder/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

