<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
	>
<channel>
	<title>Comments on: Actionscript string replacement and international currency.</title>
	<atom:link href="http://joelhooks.com/2008/01/15/actionscript-string-replacement-and-international-currency/feed/" rel="self" type="application/rss+xml" />
	<link>http://joelhooks.com/2008/01/15/actionscript-string-replacement-and-international-currency/</link>
	<description>If it feels like magic, there's probably a trick. - rands</description>
	<lastBuildDate>Sat, 04 Sep 2010 16:45:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Kazuyoshi Tlacaelel</title>
		<link>http://joelhooks.com/2008/01/15/actionscript-string-replacement-and-international-currency/comment-page-1/#comment-3</link>
		<dc:creator>Kazuyoshi Tlacaelel</dc:creator>
		<pubDate>Thu, 01 May 2008 01:44:42 +0000</pubDate>
		<guid isPermaLink="false">http://joelhooks.com/2008/01/15/actionscript-string-replacement-and-international-currency/#comment-3</guid>
		<description>I rather use the following regular expression

/\$([\d,]+)\.(\d+)/

The one you have above is

/\$([\d,]+.\d+)+/i;

the difference is that you are matching a dot between
numbers, but in regular expressions a dot basically means
any char meaning you could match anything instead of the dot
for example.

  &quot;$324!234&quot;
  &quot;$324x234&quot;
  &quot;$324%234&quot;

and plus the first one independently captures both the first and second number after a dot, making sure that it is a dot. you might wanna make a stronger regex though because in both cases you could match something like

first case
  &quot;$,,,,,,,&quot;
  &quot;$,,0,0,,&quot;

second case
  &quot;$,,,,,,,&quot;
  &quot;$3,4%2,4&quot;

I would recomend to remove all commas before getting the price
or make a more specific regex for the problem presented above

cheers!</description>
		<content:encoded><![CDATA[<p>I rather use the following regular expression</p>
<p>/\$([\d,]+)\.(\d+)/</p>
<p>The one you have above is</p>
<p>/\$([\d,]+.\d+)+/i;</p>
<p>the difference is that you are matching a dot between<br />
numbers, but in regular expressions a dot basically means<br />
any char meaning you could match anything instead of the dot<br />
for example.</p>
<p>  &#8220;$324!234&#8243;<br />
  &#8220;$324&#215;234&#8243;<br />
  &#8220;$324%234&#8243;</p>
<p>and plus the first one independently captures both the first and second number after a dot, making sure that it is a dot. you might wanna make a stronger regex though because in both cases you could match something like</p>
<p>first case<br />
  &#8220;$,,,,,,,&#8221;<br />
  &#8220;$,,0,0,,&#8221;</p>
<p>second case<br />
  &#8220;$,,,,,,,&#8221;<br />
  &#8220;$3,4%2,4&#8243;</p>
<p>I would recomend to remove all commas before getting the price<br />
or make a more specific regex for the problem presented above</p>
<p>cheers!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
