|
Microsoft® Visual Basic® Scripting Edition Global Property |
Language Reference Version 5 |
Sets or returns a Boolean value that indicates if a pattern should match all occurrences in an entire search string or just the first one.
object.Global [= True | False ]The object argument is always a RegExp object. The value of the Global property is True if the search applies to the entire string, False if it does not. Default is True.
The following code illustrates the use of the Global property (change the value assigned to Global property to see its effect):Function RegExpTest(patrn, strng) Dim regEx ' Create variable. Set regEx = New RegExp ' Create regular expression. regEx.Pattern = patrn ' Set pattern. regEx.IgnoreCase = True ' Set case insensitivity. regEx.Global = True ' Set global. RegExpTest = regEx.Execute(strng) ' Execute search. End Function MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))