code: function(input) {
  
        // Specials to be escaped by default.
        var specials = ['&','|','!','>','<','=','~','(',')',','];
  
        var specialsRegex = new RegExp('[' + specials.join('\\') + ']', 'g');
  
        if (input && typeof input === 'string') {
          input = input.replace(specialsRegex, '\\$&');
        }
  
        return input;
      }
docs: Escape special characters from a string (with "\").