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!

Split string with Regex

user6248369Jun 4 2018 — edited Jun 5 2018

Hello,

I need help with Oracle Regex please. I need to split the string that looks like this: "0123840000BLAH BLAH blah (blah)" into digits and alpha. Some data will not have brackets, only words. The following gives me only the first BLAH:

SELECT REGEXP_SUBSTR('0123840000BLAH BLAH blah (blah)', '[[:alpha:]]+') AS alpha_only

FROM dual

/

OR

SELECT REGEXP_SUBSTR('0123840000BLAH BLAH blah', '[[:alpha:]]+') AS alpha_only

FROM dual

/

Is there a way to get the whole string after last digit without looping with level and connect by please? Again, some data has brackets and some does not.

Thank you very much to all,

Art.

This post has been answered by Gaz in Oz on Jun 5 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 3 2018
Added on Jun 4 2018
12 comments
789 views