Help Center

CRegExp.Executemethod

Executes a regular expression search against a specified string.

WindowsmethodCRegExp.incdocumented

Syntax

FUNCTION Execute (BYREF wszSourceString AS CONST WSTRING) AS BOOLEAN

Parameters

NameDescription
wszSourceStringThe string to be parsed.

Return value

BOOLEAN. True on success or False on failure.

Description

Executes a regular expression search against a specified string.

Example

#include once "AfxNova/CRegExp2.inc" USING AfxNova DIM pRegExp AS CRegExp pRegExp.Pattern = "is." pRegExp.IgnoreCase = TRUE pRegExp.Global = TRUE IF pRegExp.Execute("IS1 is2 IS3 is4") = FALSE THEN PRINT "No match found" ELSE DIM nCount AS LONG = pRegExp.MatchesCount FOR i AS LONG = 0 TO nCount - 1

PRINT "Value: ", pRegExp.MatchValue(i)
  PRINT "Position: ", pRegExp.MatchPos(i)
  PRINT "Length: ", pRegExp.MatchLen(i)
  PRINT

NEXT END IF

Reference

  • Include file CRegExp.inc
  • Defined in AfxNova/CRegExp.inc:253
  • Documented in Windows/Windows Script/CRegExp Class.md
  • Topic: CRegExp Class