Closed trinker closed 9 years ago
The fixed argument has been added.
rm_between
andr_between_multiple
pick up afixed
argument. Previously,left
andright
boundaries containing regular expression special characters were fixed by default (escaped). This did not allow for the powerful use of a regular expression for left/right boundaries. Thefixed = TRUE
behavior is still the default but users can now setfixed = FALSE
to work with regular expression boundaries. This new feature was inspired by @Ronak Shah's StackOverflow question: http://stackoverflow.com/q/31623069/1000343
Using qdapRegex version >= 4.1 you can do the following.
x <- c(
"There are 2.3 million species in the world",
"There are 2.3 billion species in the world"
)
rm_between(x, left='There', right = '[mb]illion', fixed = FALSE,
include=TRUE, extract = TRUE)
## [[1]]
## [1] "There are 2.3 million"
##
## [[2]]
## [1] "There are 2.3 billion"