counts: Counts

Description Usage Arguments Functions See Also

Description

Functions to restrict a regex to a specific number

Usage

1
2
3
4
5
6
7
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

  1. greedy: match the longest string. This is the default matching type.

  2. lazy: match the shortest string. This matches the shortest string from the same anchor point, not necessarily the shortest global string.

  3. possessive: match and don't allow backtracking

low

An integer number for the lower limit.

high

An integer number for the upper limit.

Functions

See Also

Other rex: %or%(), capture(), character_class(), group(), lookarounds, not(), rex(), shortcuts, wildcards


rex documentation built on Nov. 26, 2021, 5:21 p.m.