fuse_regex | R Documentation |
Combines a vector or list of regular expressions to a single one (by logical OR).
fuse_regex(..., .literal = FALSE)
... |
Regular expressions. All elements will be converted to type character before fusing. Dynamic dots are supported. |
.literal |
Whether or not the input should be interpreted literally instead of as regular expressions. If |
A character scalar.
The rex package which provides an intuitive framework to build complex regular expressions.
Other string functions:
as_chr()
,
as_comment_str()
,
as_line_feed_chr()
,
as_str()
,
capitalize_first()
,
dsv_colnames()
,
enum_str()
,
escape_lf()
,
prettify_nr()
,
sentenceify()
,
wrap_chr()
# perform some (nonsense) Jane Austen text extraction
regex <- c("My dear Jane",
"make haste, ",
"(?i)\\bevil")
readr::read_lines(file = "https://www.gutenberg.org/cache/epub/1342/pg1342.txt") |>
stringr::str_subset(pattern = pal::fuse_regex(regex))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.