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.
我正在尝试使用 Reg Ex 从所有锚标签中删除 href attr,用于打印页面。虽然我需要锚点中的文本值。
您不能只使用 CSS 设置链接样式吗?您可以创建两种不同的样式:一种用于“正常”网络访问,另一种用于打印。在打印样式中,您不会在视觉上增强链接。
永远不要使用正则表达式解析标记。坏的!
http://htmlparsing.icenine.ca