<?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/"
	>

<channel>
	<title>Web App Solution Blog &#187; regex</title>
	<atom:link href="http://www.webappsolution.com/wordpress/category/regex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webappsolution.com/wordpress</link>
	<description>When you're in need of an appsolution</description>
	<pubDate>Thu, 05 Apr 2012 19:39:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flex &amp; ActionScript Regex List</title>
		<link>http://www.webappsolution.com/wordpress/2010/09/01/actionscript-regex-list/</link>
		<comments>http://www.webappsolution.com/wordpress/2010/09/01/actionscript-regex-list/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 12:53:11 +0000</pubDate>
		<dc:creator>brianr</dc:creator>
		
		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[flex]]></category>

		<category><![CDATA[regex]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://www.webappsolution.com/wordpress/?p=840</guid>
		<description><![CDATA[I&#8217;m not great with regex since I don&#8217;t use it a ton so I constantly find myself looking up simple, reusable regex statements&#8230;thought I&#8217;d just start listing them as I use them in case someone else finds them useful. This will start with just a couple examples that we&#8217;ll continue to add to.
Assume the following [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not great with regex since I don&#8217;t use it a ton so I constantly find myself looking up simple, reusable regex statements&#8230;thought I&#8217;d just start listing them as I use them in case someone else finds them useful. This will start with just a couple examples that we&#8217;ll continue to add to.</p>
<p>Assume the following vars:</p>
<pre class="brush: as3;">
var myString:String;
var pattern:RegExp;
var resultString:String;
var isSuccess:Boolean;
</pre>
<p><strong>Remove All Spaces</strong></p>
<pre class="brush: as3;">
myString = &quot;The quick brown fox.&quot;;
pattern = /\s+/g;
resultString = myString.replace(pattern, &quot;&quot;);
trace(resultString); // Thequickbrownfox.
</pre>
<p><strong>Remove Special Characters &#038; Spaces</strong></p>
<pre class="brush: as3;">
myString = &quot;The 123 quick 456 brown !@#$% fox.&quot;;
pattern = /\W/g;
resultString = myString.replace(pattern, &quot;&quot;);
trace(resultString); // The123quick456brownfox
</pre>
<p><strong>Remove Special Characters &#038; Numbers &#038; Spaces</strong></p>
<pre class="brush: as3;">
myString = &quot;The 123 quick 456 brown !@#$% fox.&quot;;
pattern = /[^a-zA-Z]+/g;
resultString = myString.replace(pattern, &quot;&quot;);
trace(resultString); // Thequickbrownfox
</pre>
<p><strong>Test URL String</strong></p>
<pre class="brush: as3;">
myString = &quot;http://yahoo.com&quot;;
pattern = /^http(s)?:\/\/((\d+\.\d+\.\d+\.\d+)|(([\w-]+\.)+([a-z,A-Z][\w-]*)))(:[1-9][0-9]*)?(\/([\w-.\/:%+@&amp;=]+[\w- .\/?:%+@&amp;=]*)?)?(#(.*))?$/i;
isSuccess = pattern.test(myString);
trace(isSuccess); // true
myString = &quot;htt://yahoo.com&quot;;
isSuccess = pattern.test(myString);
trace(isSuccess); // false
</pre>
<p><strong>Trim String (With Tabs &#038; Returns): Courtesy of <a href="http://jeffchannell.com/ActionScript-3/as3-trim.html" target="_blank">Jeff Channel</a></strong></p>
<pre class="brush: as3;">
myString = myString = &quot;The quick brown fox.                   		&quot;;
pattern = /^\s+|\s+$/gs;
resultString = myString.replace(pattern, &quot;&quot;);
trace(resultString); // &quot;The quick brown fox.&quot;
</pre>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Flex+%26+ActionScript+Regex+List+http://ciya4.th8.us" title="Post to Twitter"><img class="nothumb" src="http://www.webappsolution.com/wordpress/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Flex+%26+ActionScript+Regex+List+http://ciya4.th8.us" title="Post to Twitter">Tweet This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.webappsolution.com/wordpress/2010/09/01/actionscript-regex-list/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

