小编Dan*_*uen的帖子

Python拆分字符串而不拆分转义字符

有没有办法分割字符串而不拆分转义字符?例如,我有一个字符串,想要用':'而不是'\:'来拆分

http\://www.example.url:ftp\://www.example.url
Run Code Online (Sandbox Code Playgroud)

结果应如下:

['http\://www.example.url' , 'ftp\://www.example.url']
Run Code Online (Sandbox Code Playgroud)

python-2.7

20
推荐指数
5
解决办法
1万
查看次数

标签 统计

python-2.7 ×1