1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] regex_replace function

Discussão em 'Outras Linguagens' iniciado por Stack, Outubro 7, 2024 às 13:52.

  1. Stack

    Stack Membro Participativo

    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...

Compartilhe esta Página