{1 - 24} GreyGrey
{25 - 49} GreenGreen
{50 - 499} BlueBlue
{500 - 4999} OrangeOrange
{5000 - 24999} RedRed
{25000+} BlackBlack

Please confirm that you would like to report this for an admin to review.


Oracle: REGEX_REPLACE solution

Oracle Consultant needs help regarding

“REGEX_REPLACE solution”





Can someone please help me with REGEX_REPLACE funtion to get following output:
String: ’12345 912387094′ output: 912387094
String: ’12345678 0915145-02′ output: 905145 — Here I want to ignore 0 at start.
String: ’1234567′ output: 1234567

with t as (
select ’12345 912387094′ col from dual
union select ’12345678 0905145-02′ col from dual
union select ’1234567′ col from dual
)
select REGEXP_REPLACE(t.col, ‘(\d+)\s(\d+)|-(\d+)’, ”) FROM t;

Above statement returns me following output:
912387094
1234567
0905145 — Here I want to ignore 0 at start.

Thanks,
Satish N


What do you suggest for

REGEX_REPLACE solution

Kindly answer!

Oracle Discussion Forums : Thread List – Oracle Database



Confirm that you would like to Remove Email Alerts for your question. You cant undo this and you will not be able to re-subscribe.


Tags

No Answers

You must be Logged In to Answer this Question

Already a Member, Log In
Not a member yet? Sign Up

Categories

Sponsors


oracle forum