I need a regular expression query to do the following
Input
'[karthick] account number is [10000010101] and my pin is [1919128]'
Output
'######## account number is ########### and my pin is #######'
In short any thing that is between [] should be replaced with #
I tried this.
SQL> with t
2 as
3 (
4 select '[karthick] account number is [10000010101] and my pin is [1919128]' str
5 from dual
6 )
7 select str, regexp_replace(str,'\[[[:alnum:]]+\]','#') str1
8 from t
9 /
STR
------------------------------------------------------------------
STR1
--------------------------------------------------------------------------------
[karthick] account number is [10000010101] and my pin is [1919128]
# account number is # and my pin is #
But i want all the letters inside [] to be replaced with #.
Thanks,
Karthick.