【发布时间】:2020-08-04 12:02:17
【问题描述】:
我有一个带有标准标题的 html 文件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title></title><link href="../Styles/stylesheet.css" type="text/css" rel="stylesheet" /></head><body><h1>Chapter 17</h1><div class="entry-content_wrap">
还有一些 div 和 p-tags 中的很多普通文本,我的问题是这些标签内是另一个标签,其文本属于句子
<p> Some text bla bla bla <other important text> bla.</p>
而且我有很多文件,我一直在寻找一个正则表达式,它可以删除周围的标签并保留其他任何内容。我正在使用 Sigil,它提供使用正则表达式查找/替换。
我现在有(\<[^p]+\>),它可以匹配<other important text>,但也有很多HTML标头,我不知何故只能捕捉到other important text周围的
【问题讨论】: