我目前正在使用httpwebrequest& httpwebresponse从网页中提取innerhtml,但我试图在标签之间提取特定数据..
例如 -
<script>
RESPONSIVE = {
example: 'Hello world',
name: 'Example',
id: '32',
};
</script>
我试图从该特定标签中提取的内容是
中的文字name:
标签
即,
Example
如果字符串以name开头,我可以做一些事情:&#39;并以&#39;结束,获取内在内容?
答案 0 :(得分:0)
您的任务的简单正则表达式可能如下所示:
^\s*(?<name>\w+): '(?<value>.*)',?$
您可以在此处试用:https://regex101.com/r/jqZfqj/2