Skip to main content
1 of 3

How to delete all the files matching regular expression in elisp?

I want to make some clean-up with auto-generated files. How can I delete all the files matching some regexp mask from within elisp? As an example of desired functionality... Something like the line below:

(delete-file "*.txt") 

should delete all the text files in the current working directory...