I have this:
11111-22222-333---444---55--5566--6-----7-
I am using this code:
overlaps.replace(/-{2}/g, '-');
however it does not work, want i am looking for is that multiple instances of - should be replaced with one - and ending dash should be removed if any.
Can anybody tell what i am doing wrong ?