我有一个字符串“[123456]Filename123”,我只想得到[]中的数字
输入:[123456] Filename123
,输出:['123456']
,我想要123456
我的代码:
from plexapi.server import PlexServer
import re
authType = 1
def getNumbers(str):
str = re.findall(r'[0-9].....', str)
return str
if authType == 1:
baseurl = 'http://localhost:32400'
token = 'token'
plex = PlexServer(baseurl, token)
pics = plex.library.section('Pictures')
print(pics.search())
for name in pics.search():
print(name.title)
print(getNumbers(name.title))
可以将
re.search
与以下模式一起使用:相关问题 更多 >
编程相关推荐