Adding regex escape global function
Replace replace functions with new regex escaping function