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!

Get the last numeric digits from a text string back to the first non numeric character

Richard LeggeApr 15 2020 — edited Apr 17 2020

Hi All,

SE 12.1

I've been fighting with REGEXP_SUBSTR REGEXP_REPLACE , INSTR etc for a while.

I need to get the last numeric digits from a string i.e.

NMC2X85732

VBA4LM2345

From this I just want 85732 and 2345..  i.e. the numbers  everything back to the first non numeric character.. (X & M in this case) 

Everything I find, seems to pull out the 2 in the middle as well

There's no guarantee there will actually be a second numeric nearer to the front, or it will be in the same place. The lengths of the strings are different too.

Appreciate your help

Rgds

Richard

This post has been answered by Frank Kulash on Apr 15 2020
Jump to Answer
Comments
Post Details
Added on Apr 15 2020
7 comments
4,714 views