[asp]中的正则表达式运用代码
(编辑:jimmy 日期: 2025/9/20 浏览:2)
今天在改一套b2b的电子商务系统时,发现ASP正则,虽然用ASP很久了,但从来没用过正则表达式,这套系统中有个正则的函数很不错,自己看吧。
复制代码 代码如下:
<%
Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches ' 建立变量。
Set regEx = New RegExp ' 建立正则表达式。
regEx.Pattern = patrn ' 设置模式。
regEx.IgnoreCase = False ' 设置是否区分字符大小写。
regEx.Global = True ' 设置全局可用性。
Set Matches = regEx.Execute(strng) ' 执行搜索。
For Each Match In Matches ' 遍历匹配集合。
On Error Resume Next
RetStr = RetStr & Match.Value&"|"
Next
RegExpTest = RetStr
End Function
str = "我来自#5565#哈哈"
strInfo = RegExpTest("#\w+(\((\b[,0-9]+\b)?\))?#", str)
Response.Write(strInfo)
%>
再看一例:
复制代码 代码如下:
Function noHtml(str)
Dim re
Set re=New RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern="(\<.*?\>)"
str=re.Replace(str,"")
re.Pattern="(\<\/.*?\>)"
str=re.Replace(str,"")
noHtml=str
End Function
几个月来,英特尔、微软、AMD和其它厂商都在共同推动“AI PC”的想法,朝着更多的AI功能迈进。在近日,英特尔在台北举行的开发者活动中,也宣布了关于AI PC加速计划、新的PC开发者计划和独立硬件供应商计划。
在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。