[Python] Regex pattern to match a string ends with multiple charachters

Discussão em 'Python' iniciado por Stack, Fevereiro 7, 2025.

  1. Stack

    Stack Membro Participativo

    I want to match a pattern that starts with $ and ends with either dot(.) or double quote("). I tried with this

    re.findall(r"\$(.+?)\.",query1)


    Above works for starting with $ and ending with . How to add OR in ending characters so that it matches with pattern ending either with . or with "

    Any suggestions ?

    Continue reading...

Compartilhe esta Página