Changed replace strings to proper regex rules