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