仅当在 in之后的一个单词and/ERT
中没有被“/V”取代时,您将如何拆分:
text <- c("faulty and/ERT something/VBN and/ERT else/VHGB and/ERT as/VVFIN and/ERT not else/VHGB propositions one and/ERT two/CDF and/ERT three/ABC")
# my try - !doesn't work
> strsplit(text, "(?<=and/ERT)\\s(?!./V.)", perl=TRUE)
^^^^
# Exptected return
[[1]]
[1] "faulty and/ERT something/VBN and/ERT else/VHGB and/ERT as/VVFIN and/ERT"
[2] "not else/VHGB propositions one and/ERT"
[3] "two/CDF and/ERT"
[4] "three/ABC"