I want to make a list of files with extend()
while ignoring any file name ending with 0 as in _file0.h5
. I have this line for concatenating all the files into a list
data_files_0.extend(sorted(glob(f"{directory}*_file{filenum}.h5") ) )
I am trying to learn how to implement regex here and I tried
filenum = re.match(r'[^0]')
by putting it above the previous line which gives the error
TypeError: match() missing 1 required positional argument: 'string'
I am pretty confused here and all the examples of f-string with regex don't help me at all.