code: function parseRegExp (str) {
    if (str instanceof RegExp) return str
    let arg = String(str).match(/^\/(.*)\/(g|i|)$|.*/)
    return new RegExp(arg[1] || arg[0], arg[2])
  }
docs: extract args if it's regex-like, i.e: [string, pattern, flag]