filesnames that contain only numbers

Questions and answers about how to do stuff
Post Reply
sbergami
Posts: 29
Joined: 21 Dec 2016 17:08

filesnames that contain only numbers

Post by sbergami »

hi to everyone,
I would need to configure a rule in filename.rules.conf that blocks the excel file if the name is composed only by numbers, for example 12345.xls.

I tried to enter

deny [0-9] \. xls $ - -
deny [0-9] \. .xlsx $ - -

but this block all excel files that contain at least one number.
What would be the correct syntax?
Thank you
Last edited by sbergami on 14 Mar 2017 08:17, edited 1 time in total.
User avatar
shawniverson
Posts: 3783
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: filesnames that contain only numbers

Post by shawniverson »

Try this

Code: Select all

^[0-9]+\.xlsx$
sbergami
Posts: 29
Joined: 21 Dec 2016 17:08

Re: filesnames that contain only numbers

Post by sbergami »

thank you for your quick relply
it works perfectly!
thank you very much
Post Reply