Description Usage Arguments References Examples
This expression uses a quantifier ?
to optionally
match things. Specifically, the question mark makes the preceding token in
the regular expression optional.
1 |
.data |
Expression to append, typically pulled from the pipe |
value |
Expression to optionally match |
Quantifiers: https://www.regular-expressions.info/optional.html
1 2 3 4 5 6 7 8 9 | rx_maybe(value = "abc")
# create expression
x <- rx() %>%
rx_start_of_line() %>%
rx_maybe("abc") %>%
rx_end_of_line(enable = FALSE)
grepl(x, "xyz") # should be true
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.