Python 正则表达式提取Windows路径中文件名

来源:互联网 发布:查域名对应IP 编辑:程序博客网 时间:2024/05/17 05:17
1. Regular Expression[^\\/:*?"<>|\r\n]+$eg.c:\foler\file.extExtract:file.ext2. Python Codeimport resubject = 'c:\\foler\\file.ext'result = re.findall(r'[^\\/:*?"<>|\r\n]+$', subject)print result

0 0
原创粉丝点击