39.6 FIND_LINKS Function

This function finds https and http hypertext links within text. The case of URL is preserved and the protocol is returned in lower case.

Syntax

FUNCTION FIND_LINKS (
    p_string     IN VARCHAR2,
    p_https_only IN BOOLEAN  DEFAULT FALSE )
RETURN wwv_flow_t_varchar2;

Parameters

Table 39-6 FIND_LINKS Function Parameters

Parameter Description

p_string

The input string.

p_https_only

If true (the default is false), only returns https:// links.

Returns

This function returns an array of links.

Example

declare
    l_string  varchar2(32767) := 'http://oracle.com i foo.com like https://carbuzz.com '||
                                 'and <a href="https://dpreview.com"> and http://google.com';
    l_results apex_t_varchar2;
begin 
    l_results := apex_string_util.find_links(l_string,false);
end;
/
-> apex_t_string (
       'https://carbuzz.com',
       'https://dpreview.com',
       'http://oracle.com',
       'http://google.com' )