Alternation
Match one string or another.
or(..., capture = FALSE) x %|% y or1(x, capture = FALSE)
... |
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. |
A character vector representing part or all of a regular expression.
or
takes multiple character vector inputs and returns a
character vector of the inputs separated by pipes. %|%
is an operator
interface to this function. or1
takes a single character vector and
returns a string collapsed by pipes.
# or takes an arbitrary number of arguments and groups them without capture # Notice the recycling of inputs or(letters, month.abb, "foo") # or1 takes a single character vector or1(c(letters, month.abb, "foo")) # Not the same as before! # Capture the group or1(letters, capture = TRUE) # Don't create a group or1(letters, capture = NA) # The pipe operator doesn't group letters %|% month.abb %|% "foo" # Usage (rx <- or("dog", "cat", "hippopotamus")) stringi::stri_detect_regex(c("boondoggle", "caterwaul", "water-horse"), rx)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.