匹配除正则表达式之外的正则表达式

Match Regex except Regex

我有这样一条短信:

22 <a data-event="event:noted:tasks" class="btn btn-default show-if-closed" title="Noted Tasks">
25 <a data-event="event:until-today" class="btn btn-default show-if-closed" title="Until Today">
28 <a data-event="event:until-one-week" class="btn btn-default show-if-closed" title="Until One Week">
31 <a data-event="event:until-one-month" class="btn btn-default show-if-closed" title="Until One Month">

现在我想替换整个文本,除了 title-Tag 中的字符串。

替换文本后我想得到这样的行:

Noted Tasks
Until Today
Until One Week
Until One Month

我需要什么 Regex-Pattern 来匹配除 title-Values 之外的文本?模式应该是通用的,不限于a-Tags

使用以下正则表达式:

^.*?title="([^"]*)".*$

并替换为 </code>。这样一来,整行都被所需的信息替换了。</p> <p>测试<a href="https://regex101.com/r/Ep3dem/2" rel="nofollow noreferrer">here</a>.</p> <hr> <p>请注意,最好使用适当的 HTML 解析器来...咳咳...解析 HTML.</p> <hr> <blockquote> <p>The pattern should be universal, not limited to a-Tags</p> </blockquote> <p>考虑到单词 <code>title 可以出现在网页的任何位置(普通文本、class 名称、关键字...),只有专用的 HTML 解析器可以帮助您在长 运行.