Reputation: 4480
I am using regex in javascript and want to replace all the digits in a number except the last four with '#'
. I have figured out how to replace all the digits with '#'
, what do I do to not replace the last four? Here is my code so far. return cc.replace(/[0-9]/g, "#")
Upvotes: 9
Views: 8585