rx_word_edge | R Documentation |
Match beginning or end of a word—a string consisting of of word characters (a–z, A–Z, 0–9 or _).
rx_word_edge(.data = NULL)
.data |
Expression to append, typically pulled from the pipe |
rx_word_edge()
x <- rx() %>%
rx_word_edge() %>%
rx_alpha() %>%
rx_one_or_more() %>%
rx_word_edge()
# create inputs
string1 <- "foobar"
string2 <- "foo 23a bar"
# matches 'foobar'
regmatches(string1, regexpr(x, string1))
# matches 'foo' and 'bar' separately
regmatches(string2, gregexpr(x, string2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.