R/regex_or.R

#' produce regular expression of "or" (e.g., ^(abc)|(def)$)
#' @param x a character vector
#' @export
regex_or <- function(x) paste0('^(', paste(x, collapse=')|('), ')$')
atusy/mytools documentation built on May 9, 2019, 12:51 p.m.