Trying to mask the US number using reg expression, I am able to format it but not able to mask properly.
This is a number which I am converting to standard format.
const phoneNo = '4345345345';
const formatted = phoneNo.replace(/(\d{3})(\d{3})(\d{4})/, '($1) $2-$3')
console.log(formatted)
output: "(434) 534-5345"
Now I need to mask it in this given format.
output: "(***) ***-5345"
I not able to implement a viable solution for this. Although I am able to implement using vanilla JavaScript.