title: Regular expression that matches number in string but not percentages
body: <p>I need to know if there is a regular expression for testing for the presence of numbers in strings that:</p>
  
  <ul>
  <li>Matches <code>Lorem 20 Ipsum</code></li>
  <li>Matches <code>Lorem 2,5 Ipsum</code></li>
  <li>Matches <code>Lorem 20.5 Ipsum</code></li>
  <li>Does <strong>not</strong> match <code>Lorem 2% Ipsum</code></li>
  <li>Does <strong>not</strong> match <code>Lorem 20.5% Ipsum</code></li>
  <li>Does <strong>not</strong> match <code>Lorem 20,5% Ipsum</code></li>
  <li>Does <strong>not</strong> match <code>Lorem 2 percent Ipsum</code></li>
  <li>Does <strong>not</strong> match <code>Lorem 20.5 percent Ipsum</code></li>
  <li>Does <strong>not</strong> match <code>Lorem 20,5 percent Ipsum</code></li>
  <li>Matches <code>Lorem 20 Ipsum 2% dolor</code></li>
  <li>Matches <code>Lorem 2,5 Ipsum 20.5% dolor</code></li>
  <li>Matches <code>Lorem 20.5 Ipsum 20,5% dolor</code></li>
  </ul>
  
  <p>That is, a regular expression that can tell me if in a string there is one or many numbers, but not as percentage value.</p>
  
  <p>I've tried something as <code>/[0-9\.,]+[^%]/</code>, but this not seems to work, I think because <em>digits then not a percentage sign</em> match also the <code>20</code> in the string <code>20%</code>. Additionally, I don't know how to tell <em>not the entire <code>percent</code> string</em> in addition to the <code>%</code> char.</p>