StrRegexFindNext Function

Action

Advances to the next matched substring and stores the result into sTarget.

Include file

Kernel.bdh

Syntax

StrRegexFindFirst( in  hRegex  : number,
                   out sTarget : string,
                   in  iLen    : number ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hRegex Valid handle to a compiled regular expression. This handle must have been generated with a previous call to StrRegexCompile.
sTarget String which receives the result of the substitution string.
iLen Size of sTarget.

Example

transaction TMain
var
  s       : string;
  sResult : string;
  hRegex  : number;
begin
  s := "page1 alpha beta omega page4 page2 gamma page3";
  StrRegexCompile(hRegex, "page[0-9]");

  if (StrRegexExecute(hRegex, s)) then
    StrRegexFindFirst(hRegex, s, sResult, STRING_COMPLETE);
    Print(sResult);

    while StrRegexFindNext(hRegex, sResult, STRING_COMPLETE) do
      Print(sResult);
    end;
  end;
  StrRegexClose(hRegex);
end TMain;