·您的位置: 首页 » 资源教程 » 编程开发 » ASP » REGULAR EXPRESSION IN VBSCRIPT

REGULAR EXPRESSION IN VBSCRIPT

类别: ASP教程  评论数:0 总得分:0
REGULAR EXPRESSION IN VBSCRIPT
Object RegExp is used to create and execute regular expression

Ex.
Code:
strTarget="test testing tested attest late start"
Set objRegExp= New RegExp \'create a regular expression

objRegExp.Pattern="test*" \'set the search pattern
objRegExp.IgnoreCase=False \'set the case sensitivity
objRegExp.Global=True \'set the scope

set colMatches=objRegExp.Execute(strTarget) \'execute the search

For Each Match in colMathes \'iterate the colMatches collection
Response.Write "Match found at position" & Match.FirstIndex & "."
Response.Write "Matched value is \'" & Match.Value & "\',<BR>"
Next

Tested Result:
Match found at position 0. Matched value is \'test\'.
Match found at position 5. Matched value is \'test\'.
Match found at position 13. Matched value is \'test\'.
Match found at position 22. Matched value is \'test\'.
-= 资 源 教 程 =-
文 章 搜 索
关键词:
类型:
范围:
纯粹空间 softpure.com
Copyright © 2006-2008 暖阳制作 版权所有
QQ: 15242663 (拒绝闲聊)  Email: faisun@sina.com
 纯粹空间 - 韩国酷站|酷站欣赏|教程大全|资源下载|免费博客|美女壁纸|设计素材|技术论坛   Valid XHTML 1.0 Transitional
百度搜索 谷歌搜索 Alexa搜索 | 粤ICP备19116064号-1