Oracle Regular Expression Examples
-- This is a simple script to split comma separated string into individual elements.

SELECT level,
  CAST(REGEXP_SUBSTR(any_str, '[^,]+', 1, LEVEL) AS VARCHAR2(10)) idx_val
FROM (SELECT '123456,789012,45AG12,N50265A' any_str 
      FROM  DUAL)
CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(any_str, '[^,]+'))+1
;

Oracle Regular Expression - SUBSTR, REPLACE

-- By changing this [^,] to other delimitters such as [^|] for pipe, pipe delimited 
-- string can be split into individual elements.

SELECT level,
  CAST(REGEXP_SUBSTR(any_str, '[^|]+', 1, LEVEL) AS VARCHAR2(10)) idx_val
FROM (SELECT '123456|789012|45AG12|N50265A' any_str 
      FROM  DUAL)
CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(any_str, '[^|]+'))+1
;

Oracle Regular Expression - SUBSTR, REPLACE


Regular Expression - Date Validation

Regular Expression - String Search

Regular Expression - String Manipulate

Regular Expression - String Manipulate

Oracle 11g: Regular Expression - Count

Oracle registered trademark of Oracle Corporation.

Last Revised On: December 24th, 2016

  364