python字符串多个分割符(借助正则表达式re)
来源:互联网 发布:手机怎么淘宝实名认证 编辑:程序博客网 时间:2024/06/05 20:15
python字符串多个分割符(借助正则表达式re)
传统的字符串分割,只是支持一个分隔符
>>> s = "Hello python-world|string,split?">>> s.split('-') ['Hello python', 'world|string,split?']
通过借助正则表达式,可以完成多个字符分割;
>>> import re>>> re.split('[-|,?]', s) ['Hello python', 'world', 'string', 'split', '']
0 0
- python字符串多个分割符(借助正则表达式re)
- python正则表达式 分割字符串
- python正则表达式(re)
- Python 正则表达式 re
- python-re【正则表达式】
- python re 正则表达式
- Python re正则表达式
- python 正则表达式 re
- Python正则表达式(re)
- re 正则表达式 Python
- python正则表达式(re)
- python re正则表达式
- python正则表达式re
- python正则表达式re
- Python Re正则表达式
- Python re(正则表达式)模块
- python正则表达式 re (一)
- python正则表达式 re (二)compile
- F
- bootstrap学习笔记(学习中。。。)
- web移动端页面性能优化方案
- Mapreduce shuffle简单过程
- OpenGL学习笔记(一)
- python字符串多个分割符(借助正则表达式re)
- Redis源码剖析和注释(十三)--- 有序集合类型键实现(t_zset)
- MapReduce setup()和cleanup()方法
- 混合调用Service(Service既能后台长期运行,又能调用Service中方法)
- UML类图几种关系的总结(依赖、聚合、组合、泛化、实现、关联)
- Eureka注册服务列表显示ip+端口
- laravel学习笔记(5)— 表单
- LeetCode 413. Arithmetic Slices
- 设计模式之---原型模式