Learn R Programming

RVerbalExpressions (version 0.0.0.9000)

any_of: Match any of these characters exactly once.

Description

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.

Usage

any_of(.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

Run this code
# NOT RUN {
any_of(value = "abc")

# create an expression
x <- any_of(value = "abc")

grepl(x, "c") # should be true
grepl(x, "d") # should be false

# }

Run the code above in your browser using DataLab