Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您能否建议我在我的 HTML 文件中替换-为的正则表达式,_但只关注href和src属性(我不需要对我的网页内容进行任何更改)。
-
_
href
src
例如:
前:
<a href="my-profile.html">PLF Series</a> <img src="images/my-sample.jpg">
后:
<a href="my_profile.html">PLF Series</a> <img src="images/my_sample.jpg">
这个需要重复,直到没有匹配:
%s/\(\(href\|src\) *= *"[^"-]*\)-/\1_/g