Skills for replacing a function with a regular expression link: replacing a function with a regular expression
The following describes how to replace a function with a regular expression link:
1)
Character before a string <a href = "http://www.aaa.cn/000011.html"> Any length character </a>
Replace with the previous character <a href = "http://www.bbb.cn/folder/show.asp? Id = 000011 "> Any character in length </a>
2)
Character before a string <a href = "http://www.aaa.cn/070006,ccc.html"> Any length character </a>
Replace with the previous character <a href = "http://www.bbb.cn/folder/aa.asp? Id = 000011 "> Any character in length </a>
3) if not, delete the link directly.
Character before a string <a href = "http://www.aaa.cn/dddd.html"> Any length character </a>
Replace it with the character following any length
The function style is as follows. Help write regular expressions. Thank you.
Function ScriptHtml (Byval ConStr, FType) Dim Re Set Re = new RegExp Re. ignoreCase = true Re. global = 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 other End Select ScriptHtml = ConStr Set Re = NothingEnd Function
The above content is about the regular expression link replacement function, and I hope you will like it.