php专区

 首页 > php专区 > 正则表达式 > asp正则表达式匹配数字$数字$数字$_正则表达式

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

分享到:
【字体:
导读:
          用asp实现的匹配:数字$数字$数字$...... 的正则...

    
复制代码 代码如下:

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))
分享到:
asp去除html标记与空格的正则_正则表达式
function nohtml(str)  dim re  Set re=new RegExp         re.IgnoreCase =true         re.Global=True         re.Pattern="(\
正则表达式在网页处理中的应用四则_正则...
正则表达式(Regular Expression)为字符串模式匹配提供了一种高效、方便的方法。几乎所有高级语言都提供了对正则表达式的支持,或者提供了现成的代码库供调用。本文以ASP环境中常见的处理任务为例,介绍正则表达式的应用技巧。 一、检验密码和邮件地址的格式 我们的第一个实例示范正则表达式的一项基本功能:抽象地描述...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……