title: python regex how to give space after specific string?
body: <p>my code:</p>
  <pre><code>text = '12\nx\n$79.17\n8\nx\n$118.75\n6\nx\n$158.33\n4\nx\n$237.50'
  
  re.sub(r'(\n)', '', text)
  &gt;&gt;&gt;12x$79.178x$118.756x$158.334x$237.50 
  </code></pre>
  <p>my expected result will be:</p>
  <pre><code> &lt;br&gt; 12x$79.17 &lt;br&gt; 8x$118.75 &lt;br&gt; 6x$158.33 &lt;br&gt; 4x$237.50 &lt;br&gt;
  </code></pre>
  <p>I want to add <code>&lt;br&gt;</code> tag before every whole number.</p>
  <p><strong>update1:</strong></p>
  <pre><code>text = short_des.replace('\n',' ')
    &gt;&gt;&gt;'12 x $79.17 8 x $118.75 6 x $158.33 4 x $237.50'
  </code></pre>
  <p>now I want to add <code>&lt;br&gt;</code> before every whole number.</p>