Removed unused functions. Fixed regex escaping.