Learn R Programming

rebus (version 0.0-4)

repeated: Repeat values

Description

Match repeated values.

Usage

repeated(x, lo, hi, lazy = FALSE)

optional(x)

lazy(x)

zero_or_more(x)

one_or_more(x)

Arguments

x
A character vector.
lo
A non-negative integer. Minimum number of repeats, when grouped.
hi
positive integer. Maximum number of repeats, when grouped.
lazy
A logical value. Should repetition be matched lazily or greedily?

Value

  • A character vector representing part or all of a regular expression.

References

http://www.regular-expressions.info/repeat.html

Examples

Run this code
x <- graph()
optional(x)
zero_or_more(x)
repeated(x, 0, Inf) # same
one_or_more(x)
repeated(x, 1, Inf) # same
repeated(x, 0)
repeated(x, 1)
repeated(x, 3)
repeated(x, 3, 5)

Run the code above in your browser using DataLab