I am not familiar with Regular Expressions in Python

34 Views Asked by At

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
0

There are 0 best solutions below