<script language="vbscript">
'strng="<a hreF='hhh' taRget='_bland'>dfdfdfdfdDDDDDddtttttttt</A><b>ffffff</b>"
strng="<p>一、 服务需求描述: </p><p><br /> 我司在与各地移动合作过程中,会出现我司需要委托当地贵宾诊室代为扣除用户积分操作,这样用户即可直接到相应科室进行就诊服务。 </p><p><br /> 二、 功能描述: </p><p><br /> 1、 在各个医院全球通贵宾诊室登陆界面中增加【贵宾诊室积分操作】栏目,作为一级栏目存在。 </p><p><br /> 2、 贵宾诊室积分界面登陆后,二级目录【积分扣除操作】需要其电话预约的数据进行读出,并增加电话号码、积分扣除数填写。已经填写过的数据,只能由其进行修改。 </p><p><br />"
Function getWhereContent(strng,nums,byref Content1,byref Content2)
'/定义
Dim tempStr, regEx, Match, Matches, regEx1, strIndex1, strIndex2, strIndex3
Set regEx = New RegExp
regEx.Pattern = "<(/S*?)[^>]*>"
regEx.IgnoreCase = false
regEx.Global = True
Set Matches = regEx.Execute(strng)
Set regEx1 = New RegExp
regEx1.Pattern = "<(/S*?)[^>]*>"
regEx1.IgnoreCase = false
regEx1.Global = True
strIndex1 = 0
strIndex2 = 0
strIndex3 = 0
'/取得字符区间
For Each Match in Matches ' 遍历匹配集合。
if Match.FirstIndex>0 then
tempStr = left(strng,Match.FirstIndex)
else
tempStr = ""
end if
tempStr = regEx1.Replace(tempStr,"")
if len(tempStr)>nums then
strIndex2 = Match.FirstIndex
exit for
else
strIndex1 = Match.FirstIndex+len(Match.value)
end if
Next
'/取得字符索引
if strIndex1=0 and strIndex2=0 then '无html标记情况
if strng>nums then
strIndex3 = strIndex1
else
strIndex3 = len(strng)-1
end if
elseif strIndex2>0 then
for i = strIndex1 to strIndex2
tempStr = left(strng,i)
tempStr = regEx1.Replace(tempStr,"")
if len(tempStr)>=nums then
strIndex3 = i-1
exit for
end if
next
elseif strIndex1>0 then
for i = strIndex1 to len(strng)
tempStr = left(strng,i)
tempStr = regEx1.Replace(tempStr,"")
if len(tempStr)>=nums then
strIndex3 = i-1
exit for
end if
next
if strIndex3=0 then
strIndex3 = len(strng)-1
end if
end if
Content1= left(strng,strIndex3+1)
Content2= right(strng,len(strng)-strIndex3-1)
End Function
getWhereContent strng,100,t1,t2
msgbox(t1)
msgbox(t2)
</script>