DECLARE
count_ NUMBER;
count_with_ignore_case_ NUMBER;
data_ CLOB;
BEGIN
data_ := 'The REGEXP_LIKE condition uses the input character set to evaluate strings.
If you specify match_parameter values that conflict, the REGEXP_LIKE condition will use the last value to break the conflict.
If the match_parameter is omitted, the REGEXP_LIKE condition will use the case-sensitivity as determined by the NLS_SORT parameter.';
count_ := REGEXP_COUNT(data_, 'the');
count_with_ignore_case_ := REGEXP_COUNT(LOWER(data_), LOWER('the'));
Dbms_Output.Put_Line('Exact Count: ' || count_);
Dbms_Output.Put_Line(' All Count: ' || count_with_ignore_case_);
END;
Useful Links:
> Oracle / PLSQL: REGEXP_COUNT Function
No comments:
Post a Comment