I don't claim to be any expert on Regular Expressions and even after reading CD's introduction to Reg Exp, I still can't figure out this one which I'm sure must be very basic.
I want to replace all the leading spaces in a string with "." chrs. I could do this using the common replace/substr/instr functions, but I reckoned it would be possible in a single regular regexp_replace call.
So far I've got this...
SQL> select regexp_replace(' FRED BLOGS WAS HERE ', '^([:space:])*', '.')
2 as result
3 from dual;
RESULT
---------------------------------
. FRED BLOGS WAS HERE
SQL>
Which is replacing the start of line with a "." and not the spaces.
But I want my result to be:-
RESULT
---------------------------------
......FRED BLOGS WAS HERE
SQL>
Cheers