Added string escape function for quote matching