Retrieve all valid email addresses from an input text

<< | IBEBlock | >>

Retrieve all valid email addresses from an input text

This IBEBlock retrieves all valid email addresses from an input text (any_text):

     execute ibeblock (any_text varchar(10000))
     returns (email varchar(100))
     as
     begin
       re = ibec_re_Create('[_a-zA-Z\d\-\.]+@[_a-zA-Z\d\-]+(\.[_a-zA-Z\d\-]+)+');
       try
         Res = ibec_re_Exec(re, any_text);
         while (Res) do
         begin
           email = ibec_re_Match(re, 0);
           suspend;
           Res = ibec_re_ExecNext(re);
         end
       finally
         ibec_re_Free(re);
       end
     end

back to top of page
<< | IBEBlock | >>