从元素中完全删除 html 属性的正则表达式 [英] regular expression to completely remove html attribute from element

查看:19
本文介绍了从元素中完全删除 html 属性的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 vb.net 并且我的数据库正在返回一个这样的字符串,其中包含一个我想删除的非常长的标题属性:

I am using vb.net and my database is returning a string like this with a really long title attribute that I want to remove:

<img title="3497fh-39848f-04ghk38-483728_part1__book1_93822-3948329928"

我试过这个正则表达式:

I tried this regex:

<?(title).*?"^*?

但它只得到title="部分.如何在引号之间找到标题和其他所有内容?

but it's only getting "title=" part. How can I find the title and everything else between the quotes?

这是一个 正则表达式测试链接

我想完全删除标题属性.

I want to completely remove the title attribute.

谢谢!

推荐答案

试试这个 Regex... 请参见 此处了解有关此Regex的更多信息.

Try this Regex... Please see here for more information on this Regex.

 <?(title)="[^"]*"

这篇关于从元素中完全删除 html 属性的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆