如何使用正则表达式将多个文件中的html代码替换为SublimeText?

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

我正在使用 Sublime Text。完全迷失了正则表达式。我有多个 html 文件:

<head>
<link rel="stylesheet" href="css/custom.css" type="text/css">
</head>

代码应更改为:

<head>
<link rel="canonical" href="http://example.com/catalog/example_unic.html" />
<link rel="stylesheet" href="css/custom.css" type="text/css">
</head>

并且每个

href="http:/example.com/catalog/example_unic.html"
应该更改为当前页面名称。我怎样才能达到这个结果?我关注了这个帖子正则表达式搜索在 Sublime 中替换 但没有得到我需要的结果。

html regex sublimetext3 sublimetext
© www.soinside.com 2019 - 2024. All rights reserved.