var string = 'some text would be here and Blah St:39.74908:-104.99482:272~Turn right over here'
var string2 = string.replace(/(?::-?\d+(?:\.\d+)?){3}~/g, '')
All instances will be replaced: number: number: number ~
Numbers can be negative and have decimal numbers
source
share