getRandomInt = function getRandomInt(min, max) {
  return Math.floor(Math.random() * ((max - min) + 1)) + min;
}
Escape a string sp that it can be used in a regular expression.
@param {string}  string   - the string to escape
@param {boolean} commands -