How to match Return character

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

Moderator: Mr_Noodle

How to match Return character Thu May 21, 2026 10:42 am • by bcarpenter
Hi Mr Noodle,

At some stage recently (I'm not sure when), Hazel has stopped recognising Return characters (line breaks) in the Contents Contains Match rule. Previously, a space character in Hazel would match with a Return character in the document. This no longer works. I can't find any way to match the return character at all, because some of my documents have patterns that are only recognisable when multiple lines are looked at together.

Is this a bug or a new feature?

Thanks.
bcarpenter
 
Posts: 3
Joined: Wed Oct 09, 2013 9:57 pm

Re: How to match Return character Fri May 22, 2026 9:37 am • by Mr_Noodle
There should be no change on that front. Are you sure there isn't some other invisible character coming into play here? Can you post specifics from your rule/file?
Mr_Noodle
Site Admin
 
Posts: 12224
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: How to match Return character Wed Jun 03, 2026 8:21 am • by bcarpenter
Mr_Noodle wrote:There should be no change on that front. Are you sure there isn't some other invisible character coming into play here? Can you post specifics from your rule/file?


Strange, because the same rule that used to work on files a few years ago no longer works. I don't know exactly when that changed.

An example might be a PDF with a line that says:

Created date:
18/8/2025

Just matching the date itself isn't useful because there are lots of dates in the document. The key is the get the text from the preceding line to match with the date.

I've tried entering the rule as Contents --> contain match --> and then copied & pasted the text directly from the PDF into Hazel, which would capture any hidden characters. It fails to match.

I'm just not sure if there's some other way I should be doing this now.
bcarpenter
 
Posts: 3
Joined: Wed Oct 09, 2013 9:57 pm

Re: How to match Return character Wed Jun 03, 2026 8:45 am • by Mr_Noodle
Try just matching the date to make sure that part of it is working at least. If the file does not contain any personal info, you can email it in along with your rule and I can see if I can figure out what's going on with it.
Mr_Noodle
Site Admin
 
Posts: 12224
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: How to match Return character Wed Jun 03, 2026 9:26 am • by bcarpenter
Mr_Noodle wrote:Try just matching the date to make sure that part of it is working at least. If the file does not contain any personal info, you can email it in along with your rule and I can see if I can figure out what's going on with it.


Yes, just matching the date works. Just matching the line above works. It's just getting the two together that doesn't work.

I've also tried doing a Command-A on the PDF, then pasting into TextEdit. You probably know that the order that the texts appears on the screen in a PDF isn't necessarily the order that the text is stored in the document itself. This copy-paste will sort that issue out. I then copy the text & line breaks from TextEdit & paste that into Hazel, but it still doesn't work.

Unfortunately, all the files I try this on are confidential in nature. Accounts, work files, etc. I'll keep an eye out for random junk mail that I can try this on, then send you a copy.
bcarpenter
 
Posts: 3
Joined: Wed Oct 09, 2013 9:57 pm


Return to Support