move part of a string to another part of the string
<p>I have a very simple textbox given to a user.</p>

<pre><code>&lt;textarea name="text"&gt;ENTER YOUR TEXT, DUDE!&lt;/textarea&gt;
</code></pre>

<p>Sometimes, users could input something like this:</p>

<pre><code>blablablatext blablabla $ 10 blablabla blablablatext
</code></pre>

<p>Which is fine but what I want to do is take the dollar symbol and automatically place it after the number (or vice versa):</p>

<pre><code>blablablatext blablabla 10 $ blablabla blablablatext
</code></pre>

<p>Basically, what I want to do is:</p>

<ol>
<li>Detect if there is a currency symbol</li>
<li>Detect if numbers appear right after the symbol</li>
<li>Detect if, for example, a letter (or nothing) appears right after the numbers</li>
<li>Take the currency symbol and place it inbetween the numbers and letters (or just after the numbers if there is nothing afterwards)</li>
</ol>

<p>What is the best way to do it? Is something like that possible?</p>
