title: JavaScript - How can I replace string with certain char in to a function
body: <p>How can I do this using regex, replacing every string with <code>!</code> wrapped in function:</p>
  
  <p>Examples:</p>
  
  <ul>
  <li><p><code>3!</code> => <code>fact(3)</code></p></li>
  <li><p><code>2.321!</code> => <code>fact(2.321)</code></p></li>
  <li><p><code>(3.2+1)!</code> => <code>fact(3.2+1)</code></p></li>
  <li><p><code>(sqrt(2)+2/2^2)!</code> => <code>fact(sqrt(2)+2/2^2)</code></p></li>
  </ul>