RegEx.Free

Top  Previous  Next

 

Syntax

function RegEx.Free(var RegEx: pointer): boolean

 

Alternative Names

RE.Free
ibec_re_Free

 

Description

Use this function to destroy the Regular Expression object, the variable that holds the pointer is set to NIL.

 

Returns TRUE if the Regular Expression object is destroyed, FALSE otherwise.

 

See also

RegEx.Create
RegEx.Exec
RegEx.Match

 

Example

execute udsblock 

as

begin

  /* create the object with an expression */

  re = RegEx.Create('[_a-zA-Z\d\-\.]+@[_a-zA-Z\d\-]+(\.[_a-zA-Z\d\-]+)+'); 

 

  try

    /* find matches in a text */

    Res = RegEx.Exec(re, 'test m@nu.nl and then some z@example.com and more, @, test. finally fake@web.com');

    while (Res <> __FALSE)

    do begin

         /* a match has been found, display it */

     email = RegEx.Match(re, 0);

         GUI.ShowMessage('Found e-mail: ' || email);

 

         /* attempt to find the next match */

         Res = RegEx.ExecNext(re);

       end

  finally

    RegEx.Free(re);

  end

end;