regex_or: Utility function to assemble a regex of alternative patterns
Description
regex_or()
takes a set of patterns and binds them with the Or ("|"
)
pattern for an easy regex of alternative patterns.
Usage
regex_or(x, .open = FALSE, .close = FALSE)
Value
A character scalar of the resulting regex.
Arguments
- x
A character vector of alternative patterns.
- .open
Whether the resulting regex should start with "|"
.
- .close
Whether the resulting regex should end with "|"
.