今天爱分享给大家带来用正则切分字符串去除非符号【面试题详解】,希望能够帮助到大家。
import re s="info:xiaoZhang 33 shandong" re.compile(r'\W').split(s) output: ['info', 'xiaoZhang', '33', 'shandong']
原文链接:https://blog.itblood.com/3850.html,转载请注明出处。
今天爱分享给大家带来用正则切分字符串去除非符号【面试题详解】,希望能够帮助到大家。
import re s="info:xiaoZhang 33 shandong" re.compile(r'\W').split(s) output: ['info', 'xiaoZhang', '33', 'shandong']