幸运的是,Python内置了:)
import rere.split('; |, ',str)更新:
在你的评论之后:
>>> a='Beautiful, is; better*thannugly'>>> import re>>> re.split('; |, |*|n',a)['Beautiful', 'is', 'better', 'than', 'ugly']
幸运的是,Python内置了:)
import rere.split('; |, ',str)更新:
在你的评论之后:
>>> a='Beautiful, is; better*thannugly'>>> import re>>> re.split('; |, |*|n',a)['Beautiful', 'is', 'better', 'than', 'ugly']