【发布时间】:2015-07-09 07:39:34
【问题描述】:
我有一个很长的 html 字符串,带有
长度 - 1
类和模式 - 字符
......uygdasd class="vip" title="Click this link to access The Big Bang Theory: The Complete Fourth Season (DVD, 2011, 3-Disc Set).....
是否可以根据其中的文本提取该字符串的一部分。减去class="vip" title="Click this link to access到(DVD, 2011的所有内容,得到这个
The Big Bang Theory: The Complete Fourth Season
感谢您的帮助。
【问题讨论】:
-
我认为提问者的英语有困难,实际上意思是“extract”(==“retain”)而不是“subtract”(=="remove")。
-
模式是否总是“点击访问...你想要的东西...(额外的东西)”?
-
@BondedDust 我想删除
class="vip" title="Click this link to access之前和class="vip" title="Click this link to access之后的所有内容,只生活The Big Bang Theory: The Complete Fourth Season对不起我的英语不好 -
@rawr 是的“点击访问...你想要的东西...(额外的东西)”是一种模式
-
不要 grep html... 使用
rvest来解析它。
标签: r string character substr substring