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!

Extract only numerics in a string until it encounters a non-numeric character

KVBFeb 20 2018 — edited Feb 21 2018

Hi All,

I am trying to extract a portion of string using regular expressions in a unstructured text. We are able to do for a patterned text.

I have the following data in one of the fields. I tried for a uniform patterned values but it didnt work for undetermined pattern

Tried using regular expressions in multiple formats but no luck.

WITH INPUT AS

(

SELECT 'IN00012345   Vchr:A0000 012345 IHG:1-800-222-5555'  FROM DUAL  -- Need IN00012345

UNION

SELECT 'CE04441234,,,,' FROM DUAL   -- Need CE04441234

UNION

SELECT 'TS00123234/6/1/2017' FROM DUAL --Need TS00123234

)

OUTPUT:

IN00012345

CE04441234

TS00123234

Any pointers on this ?

Thanks

KVB

This post has been answered by Etbin on Feb 21 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 21 2018
Added on Feb 20 2018
4 comments
1,426 views