The technique of replacing a regular expression chain with a function is as follows:
1)
The character before the string <a href= "http://www.aaa.cn/000011.html" > any length character </a> following character
Replace with the previous character <a href= "http://www.bbb.cn/folder/show.asp?id=000011" > any length character </a> after character
2)
The character before the string <a href= "http://www.aaa.cn/070006,ccc.html" > any length character </a> following character
Replace with the previous character <a href= "http://www.bbb.cn/folder/aa.asp?id=000011" > any length character </a> after character
3) do not belong to the above situation, directly delete the link
The character before the string <a href= "http://www.aaa.cn/dddd.html" > any length character </a> following character
Replace the character behind any length character of the preceding character
The function's style is as follows, helps write the regular expression, thanks.
Function scripthtml (Byval constr,ftype)
Dim Re
Set re=new RegExp
re.ignorecase =true
Select Case FType
Case 1
re.pattern= "Regular expression"
constr=re.replace (Constr, "") Case
2
re.pattern= "Regular expression"
constr= Re.replace (Constr, "") case the other end
Select
scripthtml=constr the
Set re=nothing end
Function
The above content is about the regular expression chain replaces the function the skill, hoped everybody likes.