| 发表于:2007-04-16 10:24:304楼 得分:80 |
首先建议楼主先把这两个字符串提取出来, function func_regexptest1(patrn, strng) as boolean '正ze表da式匹配操作(?找个数) dim regex, match, matches set regex = new regexp regex.pattern = patrn regex.ignorecase = true regex.global = true set matches = regex.EXECute(strng) for each match in matches str1 = str1 & match.value next msgbox str1 end function 然后: function func_replacetest(patrn, replstr, str as string) '正ze表da式匹配操作(替?) dim regex set regex = new regexp regex.pattern = patrn regex.ignorecase = true regex.global = true regex.EXECute (str) str2 = regex.replace(str, replstr) func_replacetest = true end function str = " <td width= " "60% " " class= " "tdl " "> ([^> ]*) </td> ¦ <input type= " "checkbox " " name= " "fr_checker_(\d+) " " " call func_regexptest1(str, "楼主的html文本 ") call func_replacetest(str, "$1$2 ", str1) msgbox str2 | | |
|