首页 > 解决方案 > 用于在大量链接列表中填充标签的“标题”属性的复杂(?)正则表达式

问题描述

标签: htmlregextextvisual-studio-code

解决方案


当然

<li>(.*) \(<a href

<li>$1 (<a title="$1" href

结果

<ol>
  <li>One plus one equals two (<a title="One plus one equals two" href="https://me.com" target="_blank">Me</a>)</li>
  <li>Your &quot;reality&quot;, sir, is lies and balderdash, and I'm delighted to say that I have no grasp of it whatsoever (<a title="Your &quot;reality&quot;, sir, is lies and balderdash, and I'm delighted to say that I have no grasp of it whatsoever" href="https://bvm.com" target="_blank">Baron von Munchausen</a>)</li>
</ol>

你将不得不审查它的双引号


推荐阅读