我想和JavaScript
更换.html
扩展一个网页,不包含像http://
和https://
协议,以确保它们是本地链接中的链接。HREF链接扩展
我已经试过这样的事情,但不能正常工作:
字符串
<a href="local/path/to/url.html"> Replace me </a>
<a href="http://external.com/to/url.html"> DON'T replace me </a>
<a href="https://external.com/to/url.html"> DON'T replace me </a>
正则表达式
/href="^(http:|https:)(.*?).html"/gm
目前尚不清楚,我里面怎么否定协议正则表达式,如果我把它们没有任何匹配。
谢谢,它完美的作品 – vitto 2014-10-07 13:52:52