more efficient replace for words using regex