code: function toRegExp (string) {
    if (isString(string) && string.startsWith('/') && string.lastIndexOf('/') !== 0) {
      const pattern = string.substr(1, string.lastIndexOf('/') - 1)
      const opts = string.substr(string.lastIndexOf('/') + 1).toLowerCase()
  
      return new RegExp(pattern, opts.includes('i') ? opts : `${opts}i`)
    }
  
    if (isString(string)) {
      return new RegExp(`^${escapeRegExp(string)}$`, 'i')
    }
  
    return string
  }
docs: convert the given string to a regular expression
  @param  {String|RegExp} prop  the string to convert
  @return {RegExp}              the regular expression