I am trying to format a text field phone number to show dashes and have found two ways. One using JS and the other using Matches Regex. I tried both examples and was not successful in my attempts. Can someone provide me direction on the best way to format a phone number so it will show the dashes in the field.
Solved
Best way to format a phone number 212-222-2222
Best answer by pogi
Can you use a jQuery telephone input mask plugin instead of custom coding it?
Look at the jquery input mask: jquery-input-mask-phone-number - npm (npmjs.com)
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

I tried the above two options and they did not work for me. 