import res = r"word\anyword\2021\August\202108_filename.csv"m = re.search(r"\d+\\([a-zA-Z]+)\\\d+", s)if m: print(m.group(1))
Standard input is empty
August
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!