title: Negate decimal number regex pattern in order to strip it with replace
body: <p>I'm trying to replace all characters, that do not match given regex pattern. While it's working for match, I can't seem to make multi-part regex patterns work with negations.</p>
  
  <p><code>[^\d.-]</code> works fine, in aspect of removing all non numeric and .- characters, but it still isn't good enough for decimal number, so I made the following pattern:</p>
  
  <pre><code>^[0-9]+(.[0-9]{1,2})?$
  </code></pre>
  
  <p>However, I do not know how to negate this to get it to work in .replace. Any ideas? I assume the same will apply to all other patterns, for example : <code>^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,6}$</code></p>
  
  <p>Thanks!</p>
  
  <p>Example inputs that are valid for decimal:</p>
  
  <pre><code>1.1
  1.00
  1.23
  23123981239.2
  2
  -1
  </code></pre>
  
  <p>Example replaces:</p>
  
  <pre><code>1.a4 =&gt; 1.4
  44.44.4 =&gt; 44.444
  qweqwe55.3 =&gt; 55.3
  </code></pre>