我爱Aspx >> Asp.Net >> 截取字符串如何截取字符串“xxxx<img xx>xxxx</img>xxxxxx<img xx>xxxx</img>”
google_ad_width = 250; google_ad_height = 250; google_ad_format = "250x250_as"; google_color_url = "000000";
中<img xx>XXX</img>
放入数组中。
第2楼. 由 caoqinghua 于 2007-6-28 17:52:57 发表
用正规则表达式验证,然后存到一个数组
第3楼. 由 caoqinghua 于 2007-6-28 17:58:37 发表
Dim doc As String = "" "需要验证的字符串
Dim f As New System.Text.RegularExpressions.Regex("<img(?<body>[\s\S]*?)</img\>")
Dim sum As Integer = f.Matches(doc).Count
Dim col As System.Text.RegularExpressions.MatchCollection = f.Matches(doc)
Dim temp(sum) As String
For i As Integer = 0 To col.Count - 1
temp(i) = col.Item(i).Groups(0).ToString
Next
第4楼. 由 wuyazhe 于 2007-6-28 22:36:05 发表
楼上的正则结果是没错。不过按你的意思,这样的正则更合适:
<img[^>]*>(?<body>[\s\S]*?)</img\>
Ҷƪл˵?
html:hidden 提交的值一直为null..[07-06]
我想实现左边为treeview,每当点一..[07-06]
java记录鼠标事件,有何思路?[07-06]
恩,请问现在MCS51还在用没?现在..[07-06]
一个类型转换问题,急!!!在线..[07-06]
求助jsp页面中取text值的问题[07-06]
jsp连接数据库出错[07-06]
(安全问题)服务器端生成的临时..[07-06]
问个问题,如何在WEB中实现只能读..[07-06]
我在javabean中写了好多html的语..[07-06]