title: Typescript regex
body: <p>I want to make typescript validation to this: 01-23-456789</p>
  <p>I have one for account number :</p>
  <pre><code>this.contractForm.controls.account.get('accNum').setValue(val.match(/[0-9]{1,8}/g)?.join('-'))
  </code></pre>
  <p>This is easy because the account numbers look like this :</p>
  <pre><code>12345678-12345678-12345678
  </code></pre>
  <p>And I'm not a regex expert unfortunately, and I don't know how to make for this, that I mentioned in my first sentence.</p>
  <pre><code> public businessNumberValidator() {
      return this.contractForm.controls.szerzodo
        .get('businessnum')
        .valueChanges.pipe(
          throttleTime(1),
          tap((val: string) =&gt; {
            const char = val.replace(/\D/g, '').split('');
            if (char.length &gt; 2) {
              char.splice(2, 0, '-');
            }
            if (char.length &gt; 5) {
              char.splice(5, 0, '-');
            }
  
            this.contractForm.controls.szerzodo.get('businessnum').setValue(char.join(''));
          }),
          untilDestroyed(this)
        )
        .subscribe();
    }
  </code></pre>
  <p>and I write this kind of solution, but I want a better one</p>