I'd like to get a list of files that apply to a regex that i have. I guess i should use os.walk, but how can i use it with regex?
Thanks.
I'd like to get a list of files that apply to a regex that i have. I guess i should use os.walk, but how can i use it with regex?
Thanks.
I'm not aware of anything in the stdlib implementing this, but it is not hard to code:
Or the more general:
If your regex can be translated into a shell expression such as
foo/*.txt
then you can useglob
.