Skip to Main Content

SQL & PL/SQL

Announcement

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!

RegEx/Substr Assistance

zooba72Nov 3 2023 — edited Nov 3 2023

Hello Everyone,

If someone has a moment, trying to figure out RegEx to parse out a value. Originally I thought I need the values between the 2nd, and 3rd “-”

regexp_SUBSTR(bk.name,'[^-]+',1,3) as ID

However, I now realize that I need the value between the 2nd and 4th “-” and I can't seem to get it right. If anyone can provide some assistance, I would appreicate it. Thank you in adavance !

ID Name

153443-1 aaa-bcs-153443-1-comp-tst-s9-1

35276-1 bbb-dpg-35276-1-comp-soc-cps-1

Resubmitting post as the table did not display properly.

Comments
Post Details
Added on Nov 3 2023
8 comments
238 views