Property: Pattern for RegExp
- Updated2024-09-12
- 1 minute(s) read
Properties > Property: Pattern for RegExp
Property: Pattern for RegExp
Specifies the text pattern of a regular expression.
Object.Pattern
| Object | RegExp Object with this property |
| Object.Pattern | String with read and write access |
The following example specifies the text pattern bc and replaces it 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