trying to fix regex for invalid escape chars