Returns the values of the input table that match a regular expression.
Syntax
grep ( p_table in apex_t_varchar2, p_pattern in varchar2, p_modifier in varchar2 default null, p_subexpression in varchar2 default '0', p_limit in pls_integer default null ) return apex_t_varchar2;
Parameters
Table 31-3 GREP Function Signature 1 Parameters
| Parameters | Description | 
|---|---|
| 
 | The input table. | 
| 
 | The regular expression. | 
| 
 | The regular expression modifier. | 
| 
 | The subexpression which should be returned. If null, return the complete table value. If 0 (the default), return the matched expression. If > 0, return the subexpression value. You can also pass a comma separated list of numbers, to get multiple subexpressions in the result. | 
| 
 | Limitation for the number of elements in the return table. If null (the default), there is no limit. | 
Example
Collect and print basenames of sql files in input collection.
declare
    l_sqlfiles apex_t_varchar2;
begin
    l_sqlfiles := apex_string.grep (
                       p_table => apex_t_varchar2('a.html','b.sql', 'C.SQL'),
                       p_pattern => '(\w+)\.sql',
                       p_modifier => 'i',
                       p_subexpression => '1' );
    sys.dbms_output.put_line(apex_string.join(l_sqlfiles, ':'));
end;
-> b:C
Parent topic: APEX_STRING