[Python] Python re.sub: ignore backreferences in the replacement string

Discussão em 'Python' iniciado por Stack, Janeiro 24, 2025.

  1. Stack

    Stack Membro Participativo

    I want to replace a pattern with a string. The string is given in a variable. It might, of course, contains '\1', and it should not be interpreted as a backreference - but simply as \1.

    How can I achieve that?

    Continue reading...

Compartilhe esta Página