fork(1) download
  1. import os, re
  2. files = ['folder/10204_09-03-2021.pdf', 'folder/04_09-03-2021.pdf']
  3. rx = re.compile(r'^[0-9]+_[0-3]?[0-9]-[0-3]?[0-9]-(?:[0-9]{2})?[0-9]{2}\.pdf$', re.I)
  4. for file in files:
  5. if rx.match(os.path.basename(file)):
  6. print(file)
  7.  
Success #stdin #stdout 0.02s 9692KB
stdin
Standard input is empty
stdout
folder/10204_09-03-2021.pdf
folder/04_09-03-2021.pdf