rx_digit: Match a digit (0–9).

View source: R/special_characters.R

rx_digitR Documentation

Match a digit (0–9).

Description

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

Usage

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()
rx_digit(inverse = TRUE)

# create an expression
x <- rx_digit()

# create input
string <- "1 apple"

# extract match
regmatches(string, regexpr(x, string))

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