Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> regexp_substr occurrences problem

regexp_substr occurrences problem

From: PhilHibbs <snarks_at_gmail.com>
Date: 18 Sep 2006 06:15:42 -0700
Message-ID: <1158585342.339360.128570@m73g2000cwd.googlegroups.com>


Why doesn't this match more than once:

DECLARE
  i NUMBER := 1;
  s VARCHAR2(10);
BEGIN
  LOOP
    s := REGEXP_SUBSTR( 'ABC|DEF|GHI|JLK', '\|[^\|]+\|', 1, i )     EXIT WHEN s IS NULL;
    i := i + 1;
    DBMS_OUTPUT.PUT_LINE( s );
  END LOOP;
END; All I get is |DEF| when I think I should get |GHI| as well. Where am I going wrong?

Phil Hibbs. Received on Mon Sep 18 2006 - 08:15:42 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US