当前位置: 首页 > 图文教程 > 脚本技术 > VBScript > VBS教程:VBscript属性-IgnoreCase 属性

VBScript
VBS教程:VBscript语句-Execute 语句
VBS教程:VBscript语句-Erase 语句
VBS教程:VBscript语句-Do...Loop 语句
VBS教程:VBscript语句-Dim 语句
VBS教程:VBscript语句-Const 语句
VBS教程:VBscript语句-Class 语句
VBS教程:VBscript语句-Call 语句
VBS教程:VBscript语句-功能介绍
VBS教程:VBscript属性-Value 属性
VBS教程:VBscript属性-Source 属性
VBS教程:VBscript属性-Pattern 属性
VBS教程:VBscript属性-Number 属性
VBS教程:VBscript属性-Length 属性
VBS教程:VBscript属性-IgnoreCase 属性
VBS教程:VBscript属性-HelpFile 属性
VBS教程:VBscript属性-HelpContext 属性
VBS教程:VBscript属性-Global 属性
VBS教程:VBscript属性-FirstIndex 属性
VBS教程:VBscript属性-Description 属性
VBS教程:VBscript属性-功能介绍

VBScript 中的 VBS教程:VBscript属性-IgnoreCase 属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-11   浏览: 39 ::
收藏到网摘: n/a

IgnoreCase 属性

设置或返回一个Boolean值,指明模式搜索是否区分大小写。

object.IgnoreCase [= True | False ]

Object 参数总是一个 RegExp 对象。如果搜索是区分大小写的,则 IgnoreCase 属性为 False;否则为 True。缺省值为 False

说明

下面的代码说明了 IgnoreCase 属性的用法(改变赋予 IgnoreCase 属性的值以观察其效果):

Function RegExpTest(patrn, strng) Dim regEx,Match,Matches ' 建立变量。 Set regEx = New RegExp ' 建立正则表达式。 regEx.Pattern = patrn ' 设置模式。 regEx.IgnoreCase = True ' 设置不区分大小写。regEx.Global=True  ' 设置全局可用性set matches=regExExecute(string )  ' 执行搜索。for each match in matches  ' 重复匹配集合RetStr=RetStr &"Match found at position "RetStr=RetStr&Match.FirstIndex&".Match Value is '"RetStr=RetStr&Match.Value&"'."&vbCRLF NextRegExpTest=RetStrEnd FunctionMsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))