In [1]:
import glob
import re
In [2]:
print(glob.glob('temp/**', recursive=True))
In [3]:
print([p for p in glob.glob('temp/**', recursive=True) if re.search('\d+\.txt', p)])
In [4]:
print([p for p in glob.glob('temp/**', recursive=True) if re.search('/\D{3}\.(txt|text)', p)])