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.
<img src="images/btn_studyroom.gif" border="0">
我是asp程序员。我需要更改所有网站以实现 Web 可访问性。
我要更改<img>标签
<img>
例子
<img~~~> 至<img~~~/>
<img~~~>
<img~~~/>
如何/>使用正则表达式添加?
/>
起初,> 之前的斜线不是“更易于访问”,而是严格符合 xhtml。我不是asp专家,但您可以尝试这种事情:
String newText = Regex.Replace(inputString, @"(<img[^>]+)(?<!/)(?=>)", "\1/");