Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- from glob import glob
- from pprint import pprint
- filePaths = []
- regex = re.compile(r'(?P<prefix>.*)<udim>(?P<suffix>.*)', re.IGNORECASE)
- search = re.search(regex, r"C:\filepath\filename.<UDIM>.tif")
- if search:
- searchPath = search.group('prefix') + r'*' + search.group('suffix')
- filePaths = glob(searchPath)
- print pprint(filePaths)
Add Comment
Please, Sign In to add comment