[Python] I am not familiar with Regular Expressions in Python

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

  1. Stack

    Stack Membro Participativo

    I want to allow only string that has "_" or "Alphabet

    import re

    expected_string = "new_tags"
    note_allowed_string = "#new_tgas" or "#123new_tag"

    # Wite and re that allow _ and Alphabet only
    pattern = re.compile("_,Alphabet") #<- what to wright

    Continue reading...

Compartilhe esta Página