手机
当前位置:查字典教程网 >编程开发 >正则表达式 >asp常用的正则表达式实现字符串的替换
asp常用的正则表达式实现字符串的替换
摘要:去除html标签正则FunctionLoseHtml(ContentStr)DimClsTempLoseStr,RegExClsTempLo...

去除html标签正则</*[^<>]*>

FunctionLoseHtml(ContentStr)

DimClsTempLoseStr,RegEx

ClsTempLoseStr=Cstr(ContentStr)

SetRegEx=NewRegExp

RegEx.Pattern="</*[^<>]*>"

RegEx.IgnoreCase=True

RegEx.Global=True

ClsTempLoseStr=RegEx.Replace(ClsTempLoseStr,"")

SetRegEx=Nothing

LoseHtml=ClsTempLoseStr

Endfunction

去除网页中的class

FunctionLoseClassTag(ContentStr)

DimClsTempLoseStr,RegEx

ClsTempLoseStr=Cstr(ContentStr)

SetRegEx=NewRegExp

RegEx.Pattern="(class=){1,}(""|'){0,1}S+(""|'|>|s){0,1}"

RegEx.IgnoreCase=True

RegEx.Global=True

ClsTempLoseStr=RegEx.Replace(ClsTempLoseStr,"")

LoseClassTag=ClsTempLoseStr

SetRegEx=Nothing

EndFunction

FunctionLoseScriptTag(ContentStr)

DimClsTempLoseStr,RegEx

ClsTempLoseStr=Cstr(ContentStr)

SetRegEx=NewRegExp

RegEx.Pattern="(<script){1,}[^<>]*>[^]*(</script>){1,}"

RegEx.IgnoreCase=True

RegEx.Global=True

ClsTempLoseStr=RegEx.Replace(ClsTempLoseStr,"")

LoseScriptTag=ClsTempLoseStr

SetRegEx=Nothing

EndFunction

FunctionLoseIFrameTag(ContentStr)

DimClsTempLoseStr,RegEx

ClsTempLoseStr=Cstr(ContentStr)

SetRegEx=NewRegExp

RegEx.Pattern="(<iframe){1,}[^<>]*>[^]*(</iframe>){1,}"

RegEx.IgnoreCase=True

RegEx.Global=True

ClsTempLoseStr=RegEx.Replace(ClsTempLoseStr,"")

LoseIFrameTag=ClsTempLoseStr

SetRegEx=Nothing

EndFunction

FunctionLoseObjectTag(ContentStr)

DimClsTempLoseStr,RegEx

ClsTempLoseStr=Cstr(ContentStr)

SetRegEx=NewRegExp

RegEx.Pattern="(<object){1,}[^<>]*>[^]*(</object>){1,}"

RegEx.IgnoreCase=True

RegEx.Global=True

ClsTempLoseStr=RegEx.Replace(ClsTempLoseStr,"")

LoseObjectTag=ClsTempLoseStr

SetRegEx=Nothing

EndFunction

FunctionLoseSpanTag(ContentStr)

DimClsTempLoseStr,RegEx

ClsTempLoseStr=Cstr(ContentStr)

SetRegEx=NewRegExp

RegEx.Pattern="<(/){0,1}span[^<>]*>"

RegEx.IgnoreCase=True

RegEx.Global=True

ClsTempLoseStr=RegEx.Replace(ClsTempLoseStr,"")

LoseSpanTag=ClsTempLoseStr

SetRegEx=Nothing

EndFunction

FunctionLoseFontTag(ContentStr)

DimClsTempLoseStr,RegEx

ClsTempLoseStr=Cstr(ContentStr)

SetRegEx=NewRegExp

RegEx.Pattern="<(/){0,1}font[^<>]*>"

RegEx.IgnoreCase=True

RegEx.Global=True

ClsTempLoseStr=RegEx.Replace(ClsTempLoseStr,"")

LoseFontTag=ClsTempLoseStr

SetRegEx=Nothing

EndFunction

FunctionLoseATag(ContentStr)

DimClsTempLoseStr,RegEx

ClsTempLoseStr=Cstr(ContentStr)

SetRegEx=NewRegExp

RegEx.Pattern="<(/){0,1}a[^<>]*>"

RegEx.IgnoreCase=True

RegEx.Global=True

ClsTempLoseStr=RegEx.Replace(ClsTempLoseStr,"")

LoseATag=ClsTempLoseStr

SetRegEx=Nothing

EndFunction

FunctionLoseDivTag(ContentStr)

DimClsTempLoseStr,RegEx

ClsTempLoseStr=Cstr(ContentStr)

SetRegEx=NewRegExp

RegEx.Pattern="<(/){0,1}div[^<>]*>"

RegEx.IgnoreCase=True

RegEx.Global=True

ClsTempLoseStr=RegEx.Replace(ClsTempLoseStr,"")

LoseDivTag=ClsTempLoseStr

SetRegEx=Nothing

EndFunction

FunctionLoseStyleTag(ContentStr)

DimClsTempLoseStr,RegEx

ClsTempLoseStr=Cstr(ContentStr)

SetRegEx=NewRegExp

RegEx.Pattern="(<style){1,}[^<>]*>[^]*(</style>){1,}"

RegEx.IgnoreCase=True

RegEx.Global=True

ClsTempLoseStr=RegEx.Replace(ClsTempLoseStr,"")

LoseStyleTag=ClsTempLoseStr

SetRegEx=Nothing

EndFunction

FunctionLoseNoteTag(ContentStr)

DimClsTempLoseStr,RegEx

ClsTempLoseStr=Cstr(ContentStr)

SetRegEx=NewRegExp

RegEx.Pattern="<>"

RegEx.IgnoreCase=True

RegEx.Global=True

ClsTempLoseStr=RegEx.Replace(ClsTempLoseStr,"")

LoseNoteTag=ClsTempLoseStr

SetRegEx=Nothing

EndFunction

FunctionLoseTableTag(ContentStr)

DimClsTempLoseStr,RegEx

ClsTempLoseStr=Cstr(ContentStr)

SetRegEx=NewRegExp

RegEx.Pattern="<(/){0,1}table[^<>]*>"

RegEx.IgnoreCase=True

RegEx.Global=True

ClsTempLoseStr=RegEx.Replace(ClsTempLoseStr,"")

LoseTableTag=ClsTempLoseStr

SetRegEx=Nothing

EndFunction

FunctionLoseTDTag(ContentStr)

DimClsTempLoseStr,RegEx

ClsTempLoseStr=Cstr(ContentStr)

SetRegEx=NewRegExp

RegEx.Pattern="<(/){0,1}td[^<>]*>"

RegEx.IgnoreCase=True

RegEx.Global=True

ClsTempLoseStr=RegEx.Replace(ClsTempLoseStr,"")

LoseTDTag=ClsTempLoseStr

SetRegEx=Nothing

EndFunction

FunctionLoseTRTag(ContentStr)

DimClsTempLoseStr,RegEx

ClsTempLoseStr=Cstr(ContentStr)

SetRegEx=NewRegExp

RegEx.Pattern="<(/){0,1}tr[^<>]*>"

RegEx.IgnoreCase=True

RegEx.Global=True

ClsTempLoseStr=RegEx.Replace(ClsTempLoseStr,"")

LoseTRTag=ClsTempLoseStr

SetRegEx=Nothing

EndFunction

【asp常用的正则表达式实现字符串的替换】相关文章:

用正则表达式来表示中文

php半小时精通正则表达式

JScript中正则表达函数的说明与应用

正则表达式的应用

php正则表达式中的非贪婪模式匹配

一个特牛的日期时间判断正则表达式

正则表达式的基本知识

正则表达式的语法

正则表达式,提取网页中的链接地址

C# 正则表达式 使用介绍

精品推荐
分类导航