我不熟悉Python中的正则表达
我想仅允许具有“ _”或“字母”的字符串
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论