Constructs a character class, sometimes called a character set. With this particular expression, you can tell the regex engine to match only one out of several characters. Simply place the characters you want to match between square brackets.

any(.data = NULL, value)

Arguments

.data

Expression to append, typically pulled from the pipe %>%

value

Expression to optionally match

References

Character class: https://www.regular-expressions.info/charclass.html

Examples

any(value = "abc")
#> [1] "[abc]"
# create an expression x <- any(value = "abc") grepl(x, "c") # should be true
#> [1] TRUE
grepl(x, "d") # should be false
#> [1] FALSE