Functions to restrict a regex to a specific number
Usage
n_times(x, n, type = c("greedy", "lazy", "possessive"))
between(x, low, high, type = c("greedy", "lazy", "possessive"))
at_least(x, n, type = c("greedy", "lazy", "possessive"))
at_most(x, n, type = c("greedy", "lazy", "possessive"))
Arguments
x
A regex pattern.
n
An integer number
type
the type of match to perform.
There are three match types
greedy: match the longest string. This is the default matching type.
lazy: match the shortest string. This matches the shortest string from the same anchor point, not necessarily the shortest global string.