sed/bash move digits from end of line to front of line : <p>Okay so I want to move all digits from end of the line to the front of the line, example of lines:</p>

<pre><code>example123
example321
example2920
</code></pre>

<p>expected output:</p>

<pre><code>123example
321example
2920example
</code></pre>

<p>the following sed command works to place numbers at the start to end -</p>

<pre><code>sed -E 's/^([0-9]+)(.*)/\2\1/' file
</code></pre>

<p>input of this is</p>

<pre><code>123example
321example
</code></pre>

<p>and output is</p>

<pre><code>example123
example321
</code></pre>

<p>but when trying to do the same for numbers at the end moved to the front I can't seem to do it..</p>

<p>I've tried changing</p>

<pre><code>^
</code></pre>

<p>to</p>

<pre><code>$
</code></pre>

<p>and other things but I'm new to sed so I don't really understand alot.</p>
