DIAdem Help

Property: Global for RegExp

  • Updated2024-09-12
  • 1 minute(s) read

Property: Global for RegExp

Specifies, whether the search for the text pattern refers to the entire character string. If you assign FALSE to the Global property, the search only refers to the first time the text pattern appears within the character string.

Object.Global
ObjectRegExp
Object with this property
Object.GlobalBoolean with read and write access

The following example replaces the text pattern bc in the entire character string:

Dim RegExpression, sText
Set RegExpression = CreateObject("VBScript.RegExp")
RegExpression.Pattern = "bc"
RegExpression.Global = TRUE
RegExpression.IgnoreCase = TRUE
sText = RegExpression.Replace("abcABC","bcdef")
Call MsgBox(sText) ' Returns abcdefAbcdef