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()#> [1] "\\b"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))#> [1] "foobar"#> [[1]] #> [1] "foo" "bar" #>