#' Construct REGEX class from character vector
#'
#' Creates a regular expression class from a character vector
#'
#' @param x character; character vectors
#' @param reverse logical; whether to reverse the class (not implemented)
#'
#' @details
#' Builds a regex class from character vector. A regular expression class are
#' character elements that are surrounded by `[` and ]` and match ANY member of
#' that class.
#'
#' @examples
#' re_class( letters[1:3] ) # [abc]
#'
#' @export
re_class <- function(x, reverse=FALSE) {
paste0( "[", paste( x, collapse="" ), "]" )
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.