在VScode中查找替换可以使用正则表达式,这大大提高了生产效率。例如匹配从字符串开始到结束,<a href="#" rel="nofollow noopener" rel="nofollow noopener" >测试</a>
(<'.*?>) //匹配到整个a标签
(>'.*?<) //匹配到整个“测试”
再比如,批量查找替换 <a href="#" rel="nofollow noopener" rel="nofollow noopener" >测试</a>
中的 href="xxx" rel="nofollow noopener" rel="nofollow noopener"
(href=".*?" rel="nofollow noopener" ) //匹配范围到 href="xxx" rel="nofollow noopener" rel="nofollow noopener"

正则用的好,下班下的早!