//<![CDATA[
function stringHandle(s)
dim re
set re = new RegExp
re.pattern = "<FONT size=""(\d+)"">"
if re.test(s) = false then
stringHandle = s
exit function
end if
Set Matches = re.Execute(s)
stringHandle = re.Replace(s, reReplace(Matches(0).SubMatches(0)))
end function
function reReplace(s)
select case s
case "1":
reReplace = "<FONT size=""17"">"
case "2":
reReplace = "<FONT size=""18"">"
case "3":
reReplace = "<FONT size=""19"">"
case "4":
reReplace = "<FONT size=""20"">"
case "5":
reReplace = "<FONT size=""21"">"
case "6":
reReplace = "<FONT size=""22"">"
case "7":
reReplace = "<FONT size=""23"">"
end select
end function
dim a,b,c
a = "asdfasdf<FONT size=""1"">内容</FONT>asfsaf<FONT size=""2"">safs内容</FONT><FONT size=""3"">内容</FONT>"
a = Replace(a,"<FONT","||<FONT")
b = split(a,"||")
c = ""
for i = 0 to ubound(b)
c = c + stringHandle(b(i))
next
msgbox c
//]]>
</script>
对函数小小改造了下,应该好用些了。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)