I have this code:
CODE JS:
const phone= /^\(?(\d{3})\)?[-]?(\d{3})[-]?(\d{4})$/;
After running this code has the following form
(123)132-1312
I want to add white space before the last parentheses as in the example below.
(123 )132-1312
Can you please tell me how to accept changes to the code so that white space?
Thanks in advance!
EDIT:
text = $(this).val().replace(/(\d{3})(\d{3})(\d{4})/, "($1)$2-$3");
var testt=$(this).val().match(text);
I added this code to call here as add white space ...