Wyodrębnij numer z ciągu

var num = txt.replace(/[^0-9]/g,'');
Disgusted Dogfish