fork download
  1. import re
  2. s = r"word\anyword\2021\August\202108_filename.csv"
  3. m = re.search(r"\d+\\([a-zA-Z]+)\\\d+", s)
  4. if m:
  5. print(m.group(1))
Success #stdin #stdout 0.03s 9604KB
stdin
Standard input is empty
stdout
August