function wrap(inner, prefix, esc) {
  if (esc) inner = escape(inner);

  switch (prefix) {
    case '!':
      return '(?!' + inner + ')[^/]' + (esc ? '%%%~' : '*?');

    case '@':
      return '(?:' + inner + ')';

    case '+':
      return '(?:' + inner + ')+';

    case '*':
      return '(?:' + inner + ')' + (esc ? '%%' : '*');

    case '?':
      return '(?:' + inner + '|)';

    default:
      return inner;
  }
}
Convert `string` to a regex string.

@param  {String} `str`
@param  {String} `prefix` Character that determines how to wrap the string.
@param  {Boolean} `esc` If `false` special characters will not be escaped. Defaults to `true`.
@return {String}