|
- import re
- string = """file = {E\:\\storage\\BUUXZJBF\\Kottwitz - 2011 - Xyz beginner's guide \; one book name .pdf},
- file = {E\:\\storage\\BZ7QHC8S\\Xyz programming - an introduction..pdf;E\:\\storage\\I5CN6Q4Y\\ABC Programming Advanced Introduction.7z;E\:\\storage\\LIEKLY4B\\NO programming - an advanced introduction chs..pdf;E\:\\storage\\4UVU3D66\\www.ccc-intro.org.html},
- howpublished = {http://www.123.org/}
- file = {E\:\\storage\\CUUXZJBG\\Tomz - 2015 - OK beginner's guide another book name.pdf}"""
- pattern = re.compile(r"\\([0-8A-Z]{8})\\([^:}]+?\.pdf)")
- m = pattern.findall(string)
- for item in m:
- print(item)
复制代码
输出
- ('BUUXZJBF', "Kottwitz - 2011 - Xyz beginner's guide \\; one book name .pdf")
- ('BZ7QHC8S', 'Xyz programming - an introduction..pdf')
- ('LIEKLY4B', 'NO programming - an advanced introduction chs..pdf')
- ('CUUXZJBG', "Tomz - 2015 - OK beginner's guide another book name.pdf")
复制代码
|
评分
-
1
查看全部评分
-
|