#python 3.6 #蔡军生 #http://blog.csdn.net/caimouse/article/details/51749579 # from re_test_patterns import test_patterns test_patterns( 'This is some text -- with punctuation.', [('[^-. ]+', 'sequences without -, ., or space')], )
'[^-. ]+' (sequences without -, ., or space) 'This is some text -- with punctuation.' 'This' .....'is' ........'some' .............'text' .....................'with' ..........................'punctuation'
在这个例子里,就把划线、句号、空格(-,., ,)等字符排除在外。
总结
以上就是python如何使用正则表达式排除集合中字符的功能详解的详细内容,更多请关注Gxl网其它相关文章!
查看更多关于python如何使用正则表达式排除集合中字符的功能详解的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did84378