rebus (version 0.0-4)

or: Alternation

Description

Match one string or another.

Usage

or(..., capture = FALSE)

x %|% y

or1(x, capture = FALSE)

Arguments

...
Character vectors.
capture
A logical value indicating whether or not the result should be captured. See note.
x
A character vector.
y
A character vector.

Value

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

References

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

See Also

paste

Examples

Run this code
or(letters, LETTERS, "foo")
letters %|% LETTERS %|% "foo"
or1(letters) # implicit non-capturing group
or1(letters, capture = TRUE)
or1(letters, capture = NA)

Run the code above in your browser using DataLab