CRegExp.Testmethod
Executes a regular expression search against a specified string and returns a boolean value that indicates if a pattern match was found.
Syntax
FUNCTION Test (BYREF wszSourceString AS CONST WSTRING) AS BOOLEAN
Parameters
| Name | Description | |
|---|---|---|
wszSourceString | The string to parse. |
Return value
BOOLEAN. True if a pattern match is found; False if no match is found.
Description
Executes a regular expression search against a specified string and returns a boolean value that indicates if a pattern match was found.
Example
DIM pRegExp AS CRegEx pRegExp.Pattern = "is." pRegExp.IgnoreCase = TRUE IF pRegExp.Test("IS1 is2 IS3 is4") = FALSE THEN PRINT "No match found" ELSE PRINT "Match found" END IF
Reference
- Include file
CRegExp.inc - Defined in AfxNova/CRegExp.inc:402
- Documented in Windows/Windows Script/CRegExp Class.md
- Topic: CRegExp Class