title: How to match exact digits count by using regex in javascript
body: <p>I need to find 3 digits after <strong>all dots</strong> <em>(.)</em>. If I give input <strong>"1.22.222"</strong>, it should return <strong><em>false</em></strong>. If I give <strong>"1.222.222"</strong> then it should return <strong><em>true</em></strong>. I have tried the below regex but it didn't work.</p>
  
  <pre><code>var reg1 = new RegExp("\\.\\d{3}");
  var reg2 = new RegExp("\\.\\d{3,3}");
  reg1.test("1.22.222") // returns true, but i need to return false.
  </code></pre>
  
  <p>How to resolve this.</p>