title: Write a regex that should match a format "02142-1209"
body: <p>Need to write Proper Regex that will maximum 9 digits and regex will match "02142-1209", but if anyone is mentioning 5 digits also then we can allow user to submit.
  Maximum 9digits, and it should have "-" included within it.</p>
  
  <p>Note- User can able to submit if he added first 5 digits.</p>
  
  <pre><code>if ( !props.postalCode )
    {
      err.postalCode = "Zip Code is Required.";
    } else if ( props.countryCode === "US" &amp;&amp; !/^[\d]+\-*[\d]\{9}$/.test( props.postalCode ) )
    {
      err.postalCode = "US Zip Codes Must Be 5 Digits";
    }
  </code></pre>