日期:2014-05-17 浏览次数:21054 次
dim str: str = "你的字符串" dim value set regex = new RegExp regex.pattern = "[^%]+(?=%>)" regex.global = true set Matchs = regex.execute( str ) for each match in Matchs value = value + match.value + "<br/>" next response.write(value)
------解决方案--------------------
(?<=\<%).*?(?=%\>) 但貌似VB不支持这种断言 js的话楼上的可以
------解决方案--------------------
s="test1,test2fasdfasfafsa<%response.write ""aaa""%"&">dfafadfafafafa<%for i=0 to 1:response.write ddd:next%"&">fdsfdfdsfsd"&_ "dddddd22222aaaaaa<%aaa=888%"&">换行……" set rx=new RegExp rx.Global=true rx.Pattern="<%([\s\S]+?)%"&">" set mc=rx.Execute(s) for each m in mc response.Write "<pre>"&m.submatches(0)&"</pre>" next set rx=nothing