This function simply joins a vector of regex characters by union,
and produces a single character regex in the form of (foo)|(bar)
.
Examples
joinRegex(c("^foo", "bar$"))
#> [1] "(^foo)|(bar$)"
joinRegex("^foo", "bar$", "[bB]az")
#> [1] "(^foo)|(bar$)|([bB]az)"