回 帖 发 新 帖 刷新版面

主题:帮帮忙(正则)

比如说:

我用正则匹配了一段数据,我不替换为空,我所有不等于我匹配的那一段数据..全部替换为空!!

ASP正则应该怎么写!!!

回复列表 (共3个回复)

沙发

Set regEx = New RegExp

建立对象

板凳

你只需要提取出来就行了啊,给你写了一个演示

Dim Matche,Matches
Set regEx = New RegExp
    regEx.Pattern = "\d+"
    regEx.Global = True
    regEx.IgnoreCase = True
Set Matches = regEx.Execute("fdsaf1321fdsa654ds641fdsa")

Dim strNewString
For Each Matche In Matches
    strNewString = strNewString & Matche.Value
Next

Call Response.Write("提取所有数字:" & strNewString)

3 楼


谢谢你..我明白了~[em4]

我来回复

您尚未登录,请登录后再回复。点此登录或注册