I have column value like:
1. input -- "This is ssn12345 string"
2. input -- "This is ssn 123456 string"
3. input -- "This is ssn#12345 string"
4. input -- "This is ssn#12345 string ssn1234678"
5. input -- "This is ssn#12345 string ssn-123456"
6. input -- "This is ssn#12345 string ssn 5678 9765"
Here ssn12345 can have dynamic length(mean length is not fixed).
output will be:
1. output -- "This is ******** string"
2. output -- "This is ********** string"
3. output -- "This is ********* string"
4. output -- "This is ********* string *********"
5. output -- "This is ********* string **********"
6. output -- "This is ********* string *************"
I am trying to replace string which is starting from ssn and end with some integer values likes we are starting with ssn1234 or ssn124567.
I am trying below query but it is replacing with single * value.
select regexp_replace('This is ssn12345 string', 'ssn[^0-9.]+', '*') from dual
This is * string
I have to replace the value from ssn to next charcter with that number of * between these.
Can someone please tell me how this can be achieved in Oracle SQL? Let me know if more details are needed on the same.