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!

regexp_replace for value between 2 different characters

User_U66J8May 30 2017 — edited May 30 2017

Hi All,

In Oracle 12c , I'm trying to extract value between the first '/' and ' -' characters using regexp_replace function. Could you please help me with the pattern ?

Here is what i tried but with no luck:

from value '65/1 - 31-MAR-17' I want to get just the 1 value which is after the '/' and before the slash '-'

select regexp_replace('65/1 - 31-MAR-17', '.*/(.+)-*', '\1' ) from dual

Result expected: 1

Result received: 1 - 31-MAR-17

Any ideas? Please keep in mind that after the slash the data could be characters or number(e.g. 001, 002, 00102, etc) but no special chars expected.

Regards,

Alex

This post has been answered by Frank Kulash on May 30 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 27 2017
Added on May 30 2017
8 comments
2,770 views