Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The use of Test method in VBS

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "the use of Test method in VBS". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the idea of Xiaobian and go deep into it slowly to study and learn "the use of Test method in VBS" together.

Performs a regular expression search on the specified string and returns a Boolean value indicating whether a matching pattern was found.

object.Test(string)

Parameter object

Required. Always a RegExp object name.

string

Required. The text string to perform a regular expression search.

description

The actual pattern that the regular expression searches for is set by the Pattern property of the RegExp object. The RegExp.Global attribute has no effect on the Test method.

The Test method returns True if a matching pattern is found; False otherwise.

The following code illustrates the use of the Test method.

Function RegExpTest(patrn, strng) Dim regEx, retVal 'Create variables. Set regEx = New RegExp 'Create regular expressions. regEx.Pattern = patrn 'Set mode. regEx.IgnoreCase = False 'Sets whether case sensitivity is applied. retVal = regEx.Test(strng) 'Perform search tests. If retVal Then RegExpTest = "One or more matches found. " Else RegExpTest = "No match found. " End IfEnd FunctionMsgBox(RegExpTest("is. ", "IS1 is2 IS3 is4")) Thank you for your reading. The above is the content of" Use of Test Method in VBS ". After studying this article, I believe you have a deeper understanding of the use of Test Method in VBS. The specific use situation still needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report