源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2021-01-12 13:09 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:asp正则表达式匹配数字$数字$数字$
    
[u]复制代码[/u] 代码如下:
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))
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部