Page 1 of 1

check filename pattern

PostPosted: Mon Jan 13, 2014 6:44 pm
by snewpers
Hi again,

is it possible to create a ruleset based on a filename pattern?

What I have is filenames in this pattern: N12345678_ABCDEFG_1

Where, 'N' is a Single letter,
'123' is a range of exactly 8 digits followed by an underscore,
'ABC' is a name no longer than 9 letters followed by an underscore,
and '1' is a a single digit.

I want the rule to work on that folder ONLY if it is a perfect match, like 'D98765432_FILENAME_4'.
I have part of it working, but the 'ABC' range is something I don't know how to fix. There's no range token to be set, or should I create and 'ANY' nested rule re-use the same rule 8 times, increasing by 1 letter each time?

Thanks!

Re: check filename pattern

PostPosted: Tue Jan 14, 2014 4:25 pm
by Mr_Noodle
I assume you are using Hazel's match patterns? If so, can't you just represent that as 9 separate letter tokens?

Re: check filename pattern

PostPosted: Wed Jan 15, 2014 2:18 am
by snewpers
Hi

Yes, I'm using match patterns. I could use 9 letter tokens, like I did with the 8 digits, but, it's a range from 1-9 letters and possibly some special characters like an dash or underscore.

Re: check filename pattern

PostPosted: Thu Jan 16, 2014 4:18 pm
by Mr_Noodle
Ah, I see. Do you have to be that strict? Could you just use the "anything" token? If you specify the _ afterwards, it should properly bound the text.