Related questions
Extracting a string between other two strings in R
I am trying to find a simple way to extract an unknown substring (could be anything) that appear between two known substrings. For example, I have a string:
a<-" anything goes here, STR1 GET_ME STR2, anything goes …
regex multiple pattern with singular replacement
I am trying to replace both "st." and "ste." with "st". Seems like the following should work but it does not:
require("stringr")
county <- c("st. landry", "ste. geneveve", "st. louis")
str_replace_all(county, c("st\\.", "ste\\."), "…