Javascript regex replace consecutive strings : I have a string that looks like this
"+919357F%7F%7F%7F%00%00%00%29Your%20OTP%20for"

I need all the consecutive %7F replaced with ~

I found a nearly working solution with this command
"+919357F%7F%7F%7F%00%00%00%29Your%20OTP%20for".replace(/[%7F]{2,}/g, '~');
but for some reason it does eat away a couple of other % marks that i need to keep intact. Also i could not understand what the {2,} stands for. I know it is responsible for the consecutive replaces but not sure why 2 or 3 makes any difference.
