<?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>I Never Finish Anythi &#187; slash</title>
	<atom:link href="http://ineverfinishanythi.com/tag/slash/feed/" rel="self" type="application/rss+xml" />
	<link>http://ineverfinishanythi.com</link>
	<description>&#34;There are two kinds of people, those who finish what they start and so on.&#34;</description>
	<lastBuildDate>Mon, 18 May 2009 15:19:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Replacing forward slashes with backslashes using Regex</title>
		<link>http://ineverfinishanythi.com/2009/04/24/replacing-forward-slashes-with-backslashes-using-regex/</link>
		<comments>http://ineverfinishanythi.com/2009/04/24/replacing-forward-slashes-with-backslashes-using-regex/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 01:19:47 +0000</pubDate>
		<dc:creator>nicholas</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[slash]]></category>

		<guid isPermaLink="false">http://ineverfinishanythi.com/?p=22</guid>
		<description><![CDATA[A buddy of mine asked me the other day how to flip all of the forward slashes in a file path to backslashes using string replace() method in AS3. He said he couldn’t find the answer anywhere online, so I guess I’ll put it here so it will hopefully help someone.]]></description>
			<content:encoded><![CDATA[<p>A buddy of mine asked me the other day how to flip all of the forward slashes in a file path to backslashes using string replace() method in AS3. He said he couldn’t find the answer anywhere online, so I guess I’ll put it here so it will hopefully help someone.</p>
<pre class="brush: as3;">
var path:String = &quot;/top/deeper/keep/going/&quot;;
var pattern:RegExp = /(\/)/g;
var fixed:String = path.replace(pattern, &quot;\\&quot;);
</pre>
<p>If you care to read an explanation of what’s going on, here we go.</p>
<p>Line 1: This is our string that we want to fix.</p>
<p>Line 2: This is our regex pattern that will grab the forward slashes. I think the part about this that may have been difficult is that you have to wrap your escaped forward slash in parentheses, or ActionScript thinks you’re trying to start a comment when you close your pattern with the next forward slash. The ‘g’ means that we want this pattern to be applied globally when we use it, and not just on the first match.</p>
<p>Line 3: This is where we use the pattern to find and replace all of the forward slashes with backslashes (escaped, of course).</p>
<p>That’s it. Pretty simple once you know how.</p>
]]></content:encoded>
			<wfw:commentRss>http://ineverfinishanythi.com/2009/04/24/replacing-forward-slashes-with-backslashes-using-regex/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</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! -->
