title: RegEx continuous validation for a specific string
body: <p>I'm trying to write a regular expression match in JavaScript for a string like [any four digits][single hyphen][three alphanumeric characters]. The validation should happen continuously. That means partial mach also should return true.</p>
  
  <p>I was able to validate strings like [any four digits][single hyphen] 
  <br>
  1232- <br>
  4323- <br>
  But I'm not able to validate the [three alphanumeric] part</p>
  
  <p>following is my regex for first two parts</p>
  
  <pre><code>let reg = /^[[0-9.\-]{1,6}]$/;
  </code></pre>
  
  <p>Successful validation is expected on strings such as</p>
  
  <pre><code>3432-ad3
  6548-333
  7654-2d1
  5649-dse
  </code></pre>