The function rx_digit()looks for tabs with the following expression: %%d and matches single digit. Plural version matches specified number of digits n (equivalent to rx_digit() %>% rx_count(n)).

rx_digit(.data = NULL, inverse = FALSE)

Arguments

.data

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

inverse

Invert match behavior, defaults to FALSE (match digit characters). Use TRUE to not match digit characters.

Examples

rx_digit()
#> [1] "\\d"
rx_digit(inverse = TRUE)
#> [1] "\\D"
# create an expression x <- rx_digit() # create input string <- "1 apple" # extract match regmatches(string, regexpr(x, string))
#> [1] "1"