The RG mask comes with a different pattern that I need!
RG Code:
function Rg(v){
v=v.replace(/\D/g,"");
v=v.replace(/(\d)(\d{4})$/,"$1.$2");
v=v.replace(/(\d)(\d{4})$/,"$1.$2");
v=v.replace(/(\d)(\d)$/,"$1-$2");
return v
}
In this code it plays the RG with the default: 88888.888-8
And the standard I need is: 88.888.888-8
Thanks for the other answers. And I would like to add a question:
"Can you use a if
at the time of typing to check how many numbers are informed to standardize on the function?"