본문 바로가기
Nuke/python

시퀀스넘버 추출

by 르면가게 2024. 12. 7.
import re
pattern = r"\.(\d+)\.(dpx|exr)"
i = "randompath/sample.00288376.dpx"
rst = re.search(pattern, i)
print(rst.group(1))

# rst => 00288376
# 혹시 몰라 확장자도 캡쳐