VBS tutorial: VBScript properties – global properties

Time:2021-12-26

Global properties

Sets or returns aBooleanValue that indicates whether the pattern matches all or only the first when searching the entire string.

object.Global [= True | False ]

Object parameters are alwaysRegExpObject. If the search is applied to the entire string,GlobalThe value of the property isTrueOtherwise, its value isFalse。 The default setting isFalse

explain

The following code illustratesGlobalAttribute usage (change)GlobalProperty and observe its effect):

Function regexptest (PATRN, strng) dim regex, match, matches' create variables. Set regex = new regexp 'creates a canonical expression. regEx. Pattern = pattern 'sets the pattern. regEx. Ignorecase = true 'sets whether letters are case sensitive. regEx. Global = true 'sets the nature of the entire process. set matches= regEx. Execute (strng) 'execute the search. For each match in matches' duplicate matching set 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"))

Recommended Today

Unity Scrollview displays large amounts of data

Original link:https://www.cnblogs.com/jingjiangtao/p/15827823.html problem Unity’s Scrollview can display a list in the form of a Scrollview. However, when there is a lot of data in the list, it will get stuck when it is displayed once with Scrollview, and the speed of generating the list will slow down. To solve this problem, you can only display […]