难以摆脱正斜杠。我正在使用stringr库

难以摆脱正斜杠。我正在使用stringr库,r,R,我在R工作,很难摆脱正斜杠。我正在使用stringr库。以下是我正在使用的字符串: she/PRP moved/VBD on/IN before/IN she/PRP could/MD be/VB asked/VBN 我想删除正斜杠和word/PRP,以获得以下结果: she moved on before she could be asked 具有正则表达式的强大功能 输入: str <- "she/PRP moved/VBD on/IN before/IN she/PRP cou

我在R工作,很难摆脱正斜杠。我正在使用
stringr
库。以下是我正在使用的字符串:

she/PRP moved/VBD on/IN before/IN she/PRP could/MD be/VB asked/VBN
我想删除正斜杠和word
/PRP
,以获得以下结果:

 she moved on before she could be asked

具有正则表达式的强大功能

输入:

str <- "she/PRP moved/VBD on/IN before/IN she/PRP could/MD be/VB asked/VBN"
输出

[1] "she moved on before she could be asked"

具有正则表达式的强大功能

输入:

str <- "she/PRP moved/VBD on/IN before/IN she/PRP could/MD be/VB asked/VBN"
输出

[1] "she moved on before she could be asked"

非常感谢Andre Elricoy如果它解决了你的问题,你应该检查这个答案。在
www.regex101.com
上了解有关regex的更多信息。这是每个编剧/程序员的必修课。非常感谢Andre Elricoy,如果它解决了你的问题,你应该检查这个答案。在
www.regex101.com
上了解有关regex的更多信息。这是每个脚本编写者/程序员的必备条件。