asp正则表达式匹配数字$数字$数字$

所属分类: 网络编程 / 正则表达式 阅读数: 1296
收藏 0 赞 0 分享
    
复制代码 代码如下:

Dim strOk,strNo 
    strOk = "12312321$12312312312$12312321$" 
    strNo = "12312321$12312312312$12312321$sdfsd" 

    Function RegExpTest(patrn, strng) 
        Dim regEx, match, matches   ' 建立变量。 
        Set regEx = New RegExp   ' 建立规范表达式。 
        regEx.Pattern = patrn   ' 设置模式。 
        regEx.IgnoreCase = True   ' 设置是否区分字母的大小写。 
        regEx.Global = false   ' 设置全程性质。 
        set matches= regEx.Execute(strng)   ' 执行搜索。 
        for each match in matches      ' 重复匹配集合 
            RetStr=RetStr &"Match found at position " 
            RetStr=RetStr&Match.FirstIndex&".Match Value is '" 
            RetStr=RetStr&Match.Value&"'."&vbCRLF 
        Next 
        IF Not IsEmpty(matches) And matches(0).Value = strng Then 
            RegExpTest = true 
        Else  
            RegExpTest = false 
        End IF 
    End Function 
    MsgBox(RegExpTest("[\d+\$]+", strOk))
更多精彩内容其他人还在看

能说明一下GETROWS的用法吗?

能说明一下GETROWS的用法吗?
收藏 0 赞 0 分享

用正则表达式过滤html代码

用正则表达式过滤html代码
收藏 0 赞 0 分享

ubb js

ubb js
收藏 0 赞 0 分享

正则表达式在javascript中的几个实例

正则表达式在javascript中的几个实例
收藏 0 赞 0 分享

简单的Html转换UBB的程序

简单的Html转换UBB的程序
收藏 0 赞 0 分享

求个简单正则

求个简单正则
收藏 0 赞 0 分享

JScript中正则表达式用法详解

JScript中正则表达式用法详解
收藏 0 赞 0 分享

取图片路径的正则

取图片路径的正则
收藏 0 赞 0 分享

文本框输入限制 [大全]

文本框输入限制 [大全]
收藏 0 赞 0 分享

UBB代码在论坛中的应用

UBB代码在论坛中的应用
收藏 0 赞 0 分享
查看更多