Value parameter will be interpreted as pairs. For example, range(c('a', 'z', '0', '9')) will be interpreted to mean any character within the ranges a–z (ascii x–y) or 0–9 (ascii x–y). The method expects an even number of parameters; unpaired parameters are ignored.

rx_range(.data = NULL, value)

Arguments

.data

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

value

Range of characters. The method expects an even number of parameters; unpaired parameters are ignored.

Examples

rx_range(value = c('1', '3'))
#> [1] "[1-3]"
# create an expression x <- rx_range(value = c('1', '3')) grepl(x, "2") # should be true
#> [1] TRUE
grepl(x, "4") # should be false
#> [1] FALSE