【发布时间】:2020-12-01 08:47:14
【问题描述】:
数据
data.frame(id = c(1, 2), text = c("something here <h1>my text</h1> also <h1>Keep it</h1>", "<h1>title</h1> another here"))
如何在此标记<h1>my text</h1> 之后保留文本,直到找到标记的下一个开头,如果该标记不存在于行中插入 0
示例输出
data.frame(id = c(1, 2), text = c("also", 0))
【问题讨论】:
-
我可以看到你已经问了几个关于使用这些标签进行操作的问题 - 你应该接受你喜欢的作为答案。