I have following code which will store all the csv filename in a list from a specific folder
import pandas as pd
import re
import os
files = os.listdir('.')
filename=[filename for filename in files if filename.endswith('.csv')]
However, in my folder, I have two types of csv files, one ends with, for example, _20.cvs(or maybe _18.csv,_01.csv), another one ends with _Raw.csv;
However I only need the first type stored in my list. I know regular expression may can help me on that, so I did some google search, and come up with the following code, but it seems doesn't work, can anyone offer a advice?
filename = [re.search(r'^\d{2}.csv'),filename).group(0) for filename in files]