fork download
  1. import re
  2. files = ['C:\\PATH\\PATH\\PATH\\thing1.xlsx', 'C:\\PATH\\PATH\\PATH\\PATH\\thing2.xlsx']
  3.  
  4. pattern = re.compile(r'\\([^\\]+)\.xlsx')
  5. for x in files:
  6. matches = pattern.findall(x)
  7. print(matches)
Success #stdin #stdout 0s 23304KB
stdin
Standard input is empty
stdout
['thing1']
['thing2']