code: function createRegexp (s) {
    let mExp = /^\/(.*)\/([gimy]*)$/.exec(s)
    if (mExp) {
      return new RegExp(mExp[1], mExp[2])
    } else {
      return new RegExp(s)
    }
  }
docs: RegExp-finding RegExp: string starts with slash, ends with slash/flags