title: Regex a decimal number with comma
body: <p>I'm heaving trouble finding the right regex for decimal numbers which include the comma separator.</p>
  
  <p>I did find a few other questions regarding this issue in general but none of the answers really worked when I tested them</p>
  
  <p>The best I got so far is:</p>
  
  <pre><code>[0-9]{1,3}(,([0-9]{3}))*(.[0-9]+)?
  </code></pre>
  
  <p>2 main problems so far:</p>
  
  <p>1) It records numbers with spaces between them "3001 1" instead of splitting them to 2 matches "3001" "1" - I don't really see where I allowed space in the regex.</p>
  
  <p>2) I have a general problem with the beginning\ending of the regex.</p>
  
  <p>The regex should match:</p>
  
  <pre><code>3,001
  1
  32,012,111.2131 
  </code></pre>
  
  <p>But not:</p>
  
  <pre><code>32,012,11.2131
  1132,012,111.2131
  32,0112,111.2131
  32131
  </code></pre>
  
  <p>In addition I'd like it to match:</p>
  
  <pre><code>1.(without any number after it)
  1,(without any number after it)
  as 1
  </code></pre>
  
  <p>(a comma or point at the end of the number should be overlooked).</p>
  
  <p>Many Thanks!
  .</p>