Matches any single digit (0-9).

xp_build_digits(pattern = NULL)

Arguments

pattern

(Optional) An existing pattern from a pipe.

Value

A regexpert object.

Examples

# Match exactly three digits
xp_build_digits() %>% xp_op_repeat(3)
#> <regexpert pattern>
#>   (?:\d){3}

# Combine digits with literal text
xp_build_literal("Year: ") %>% xp_build_digits() %>% xp_op_repeat(4)
#> <regexpert pattern>
#>   (?:Year: \d){4}