import res = "test_20200331_2020041612345678.csv"m = re.search(r"(?<=_)\d{8}(?=\d*\.)", s)if m: print(m.group())
Standard input is empty
20200416
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!