For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!
Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.
col subval for a20 with t(val) as( select '*abc**mn*opqrs*tu*v*wxyzabc*' from dual), rec(val,subval,LV,maxLV) as( select val,RegExp_Substr(val,'[^*]+',1,1),1, RegExp_Count(val,'[^*]+') from t union all select val,RegExp_Substr(val,'[^*]+',1,Lv+1),Lv+1,maxLV from rec where Lv < maxLV) select*from rec; val subval LV maxLV ---------------------------- ------- -- ----- *abc**mn*opqrs*tu*v*wxyzabc* abc 1 6 *abc**mn*opqrs*tu*v*wxyzabc* mn 2 6 *abc**mn*opqrs*tu*v*wxyzabc* opqrs 3 6 *abc**mn*opqrs*tu*v*wxyzabc* tu 4 6 *abc**mn*opqrs*tu*v*wxyzabc* v 5 6 *abc**mn*opqrs*tu*v*wxyzabc* wxyzabc 6 6
with T as (select '*abc**mn*opqrs*tu*v*wxyzabc*' TXT from dual) select txt from ( select regexp_substr(txt,'[^\*]+',1,level) txt from T connect by level <= length(regexp_replace(txt,'[^\*]+'))+1 ) where txt is not null / TXT ---------------------------- abc mn opqrs tu v wxyzabc 6 rows selected. Elapsed: 00:00:00.01