标签: r
尝试拆分并包含。到目前为止,我可以看看好了。
string_txt <- "apple eat bear" strsplit(string_txt, "(?<=eat)", perl = TRUE) [[1]] [1] "apple eat" " bear"
但是,当我试着向前看时,“吃”这个词就会分开。
strsplit(string_txt, "(?=eat)", perl = TRUE) [[1]] [1] "apple " "e" "at bear"