📜  re.split 在列表中返回 none - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:27.752000             🧑  作者: Mango

代码示例1
# example of expression giving none
re.split(r'(\+)|(\-)|(\*)', text)

# you are getting null because it matches all the groups
# every time it finds a match.
# so just remove the paranthsis after this |
# correct for not getting null

re.split(r'\+|\-|\8', text)