use iterator based regex replace