changed string.replace to use regExp

fixes problem where only first thousands separator is removed