File extension match in python using RegexMatchingEventHandler

175 views Asked by At

I want to apply basic pattern match on the file extension (.gz) using both RegexMatchingEventHandler and re.

I am getting .gz and .gz.tmp files in my input directory and I only want to pick .gz files.

I tried using (.)*.gz$ and similar patterns but they are not working with RegexMatchingEventHandler. Please help me with a pattern which works for both RegexMatchingEventHandler and re.

1

There are 1 answers

0
Clobro On

/.*\.gz/ should work with your situation, you didn't escape the '.' in '.gz'.