The example is you have a folder with files numbered files_0.jpg to files_10.jpg in a folder /tmp/folder.
I'm trying to figure out how to delete files_0.jpg to files_4.jpg while leaving files files_5.jpg to files_10.jpg.
For extra points, same scenario, but, I want to delete files_0.jpg to files_4.jpg and files_8.jpg to files_10.jpg leaving files_5.jpg, files_6.jpg and files_7.jpg.
I'm trying to figure out how to do this in Ansible and I am stuck at trying to use a regex.