'I am not familiar with Regular Expressions in Python

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


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source