如何全面了解ASP的RegExp对象正则表达式的所有用法?
- 内容介绍
- 文章标签
- 相关推荐
本文共计2660个文字,预计阅读时间需要11分钟。
RegExp对象提供简单的正则表达式支持功能。RegExp对象的用法如下:
+ 复制代码javascriptfunction RegExpTest(patrn, strng) { Dim regEx, Match, Matches Set regEx=New RegExp(patrn) regEx.Test(strng)}
RegExp对象的用法:
复制代码 代码如下:
Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches ' 建立变量。
Set regEx = New RegExp ' 建立正则表达式。
regEx.Pattern = patrn ' 设置模式。
regEx.IgnoreCase = True ' 设置是否区分字符大小写。
regEx.Global = True ' 设置全局可用性。
Set Matches = regEx.Execute(strng) ' 执行搜索。
For Each Match in Matches ' 遍历匹配集合。
本文共计2660个文字,预计阅读时间需要11分钟。
RegExp对象提供简单的正则表达式支持功能。RegExp对象的用法如下:
+ 复制代码javascriptfunction RegExpTest(patrn, strng) { Dim regEx, Match, Matches Set regEx=New RegExp(patrn) regEx.Test(strng)}
RegExp对象的用法:
复制代码 代码如下:
Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches ' 建立变量。
Set regEx = New RegExp ' 建立正则表达式。
regEx.Pattern = patrn ' 设置模式。
regEx.IgnoreCase = True ' 设置是否区分字符大小写。
regEx.Global = True ' 设置全局可用性。
Set Matches = regEx.Execute(strng) ' 执行搜索。
For Each Match in Matches ' 遍历匹配集合。

