rx_range: Match any character within the range defined by the...

View source: R/rules.R

rx_rangeR Documentation

Match any character within the range defined by the parameters.

Description

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.

Usage

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'))

# create an expression
x <- rx_range(value = c('1', '3'))

grepl(x, "2") # should be true
grepl(x, "4") # should be false

RVerbalExpressions documentation built on May 29, 2024, 6:47 a.m.