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
1 Answer
You can use REGEXP_REPLACE:
SQL> SELECT regexp_replace('test1string', '([[:digit:]])', '000\1') tx FROM dual;
TX
--------------
test0001string