55.8 FIND_TAGS Function

This function finds all strings identified by a tag prefix. The search is case insensitive and also ignores white space and special characters.

This function searches for a tag prefix (such as #) at the start of a string or within the text after a space. This function also recognizes repeated tag prefixes (such as ##).

The return excludes the prefix identifier (tag instead of #tag).

Syntax

APEX_STRING_UTIL.FIND_TAGS (
    p_string            IN  VARCHAR2,
    p_prefix            IN  VARCHAR2 DEFAULT '#',
    p_exclude_numeric   IN  BOOLEAN DEFAULT TRUE )
RETURN apex_t_varchar2;

Parameters

Parameter Description
p_string The input string.
p_prefix The tag prefix (default #).
p_exclude_numeric If TRUE (default), excludes values that only contain the tag prefix and digits.

Returns

This function returns the found tags in upper case.

Example

DECLARE
    l_tags   apex_t_varchar2;
    l_string varchar2(4000) := 'how now #orclapex @mike brown #cow';
BEGIN
    l_tags := apex_string_util.find_tags(l_string,'#');
    l_tags := apex_string_util.find_tags(l_string,'@');
END;
/
-> apex_t_varchar2('#ORCLAPEX','#COW')
-> apex_t_varchar2('@MIKE')