Object: RegExp
- Updated2024-09-12
- 1 minute(s) read
Objects > Object: RegExp
Object: RegExp
The RegExp object provides support for simple, regular expressions in VBS. Use the RegExp object to define a text pattern that you can search for and/or replace in a character string.
The following example shows how you can generate a RegExp object and use this object to replace a text:
Dim RegExpression, sText Set RegExpression = CreateObject("VBScript.RegExp") RegExpression.Pattern = "bc" sText = RegExpression.Replace("abcABC","bcdef") Call MsgBox(sText) ' Returns "abcdefABC"
| Note The SmartInfo for the RegExp object, its properties and methods, is only available if you generate the RegExp object with the CreateObject statement. The SmartInfo is not available if you generate the object with New. |
Properties
Global | IgnoreCase | Multiline | Pattern