I'm trying to replace some repeated characters using regex:
var string = "80--40";
string = string.replace(/-{2}/g,"-"); // result is "80-40"
This replaces two minuses with one, but how could I change the code so that it replaces two or more? I only want one minus symbol to appear between the numbers.