Closed kwstat closed 5 years ago
At this moment, I believe rx_range
is you're only option.
Nested rx_*
we're an issue early on see #9, rx_group
was one suggestion to your example. We had a lot of features at one point but (if I remember correctly) I removed some of them to bring it back to the VerbalExpressions structure (i.e. how all the other implementations work), still this repo does have extras.
This is now possible using the old rx.string
method, install the latest if you'd like to give it a try:
library(RVerbalExpressions)
rx() %>%
rx_either_of(
rx_uppercase(),
rx_digit()
)
#> [1] "([A-Z]|\\d)"
Or with rx_range
:
rx() %>%
rx_range(c("A", "Z", 0, 9))
#> [1] "[A-Z0-9]"
Without using rx_range(), how can I get an rx like [A-Z0-9] ? I tried many ideas and failed. For example:
This doesn't work because each part is sanitized.