0

i am having one string test1string i need to pad three zeros before every digit.the result string should be test0001string.I have tried PAD,regexp_instr but i didn't get the correct result.can anybody explain me
thanks in advance

0

1 Answer 1

4

You can use REGEXP_REPLACE:

SQL> SELECT regexp_replace('test1string', '([[:digit:]])', '000\1') tx FROM dual;

TX
--------------
test0001string
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.