Matching full words not partials

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Matching full words not partials Fri Jul 26, 2024 8:06 am • by mark.haynes
Hiya all,

I'm new to Hazel and trying to figure this one out.

I have set up a rule that if the name contains cho to move a file from desktop to docs.
The problem is if the file name has chocolate for instance this also moves.

Examples of what I want to move and what I don't are below:

Ad for CHO.pdf - Should move
Chocolate Ad.pdf - Should NOT move
CHO - Advert.pdf - Should Move
cho-ad.psd - should move
hot chocolate.pdf - should not
choose this file.psd - should not.

Can you suggest what I use to match this?

Many Thanks
mark.haynes
 
Posts: 1
Joined: Fri Jul 26, 2024 8:01 am

Re: Matching full words not partials Fri Jul 26, 2024 9:34 am • by Mr_Noodle
You can try looking for "cho " (that's a space after the word" and "cho.". Not ideal but should get the job done for most cases. Or use a pattern so you can match symbols or numbers (basically anything that isn't another letter). You will probably also have to match against Full Name so you get the extension included.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support