RegEx - 如何在选定字符后添加任何内容

问题描述 投票:0回答:0

我正在尝试将 rel="nofollow noopener" target="_blank" 添加到 HTML 中的所有链接。

这是示例 HTML 代码:

<li><a href="https://somewebsite.com/">Some website</a></li>
<li><a href="https://awesomewebsite.net/">Awesome Website</a></li>
<li><a href="https://coolwebsite.org/">Cool Website</a></li>

<p>Also <a href="https://badsite.com/">check this website</a></p>! 

我对正则表达式一无所知,但在阅读了我写的一些资源后

href([^>]*)

选择所有链接,但我不确定如何在我选择的内容之后在 Notepad++ 中添加 rel="nofollow noopener" target="_blank" :)

我正在尝试使用 RegEx 将 rel="nofollow noopener" target="_blank" 添加到所有链接

search replace notepad++
© www.soinside.com 2019 - 2024. All rights reserved.