title: Regex to turn a list of strings into numbers following a specific rule
body: <p>Suppose I have a list in the form;</p>
  <pre><code>lst = [&quot;5kxn&quot;] # 1 string only for example
  </code></pre>
  <p>5k denotes 5000 and xn denotes n times, the processed list should be;</p>
  <pre><code>[5*1e3 for i in range(n)] # float values
  #Not this literally but a list of n 5000's.
  </code></pre>
  <p>I am aware I can do this using non re methods but it could be bug prone, and my re skills are not good enough to come up with a method to pull off this conversion</p>
  <p>Here is a dictionary of multipliers:</p>
  <pre><code>replace_dict = {'a': '1e-18', 'f': '1e-15', 'p': '1e-12',
                  'n': '1e-9',  'u': '1e-6',  'm': '1e-3',
                  'c': '1e-2',  'd': '1e-1', 'da': '1e1',
                  'h': '1e2',   'k': '1e3',   'M': '1e6',
                  'G': '1e9',   'T': '1e12',  &quot;P&quot;: '1e15',
                  'E': '1e18'}
  </code></pre>
  <p>Desired output is a list. For example <code>[&quot;2kx1&quot;,&quot;3kx2&quot;,&quot;4k&quot;]</code> will be <code>[2000.0,3000.0,3000.0,4000.0]</code></p>