function escapeStringForRegex(regexString) {
  // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems
  // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20.
  return regexString.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d');
}
Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to
`new RegExp()`.

@param regexString The string to escape
@returns An version of the string with all special regex characters escaped