I'm trying to replace the following string with offset of 2 characters from begining and end. Example input: A9999999999 Expected output: A9********99 I have tried the following but not able to narrow down to exact format regexp_replace(a, '[0-9]', '*') as a REGEXP_REPLACE(a, '[0-9]', '*', 6) as a REGEXP_REPLACE(a, '\1((.*)\4$)', '\1*******\3') as a Continue reading...