Matching a sentence

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

Moderator: Mr_Noodle

Matching a sentence Wed Jan 31, 2018 1:42 am • by Rug664
I am creating some rules that will automatically match receipts I receive via gmail which I save. The receipts are html emails, not a pdf attachment. I save the message manually as a pdf. I am trying to write a hazel rule that will match all PayPal receipts and rename it with the name of the recipient.

When the email is printed the subject line is printed on a single line, such as this:
Receipt for your payment to SONY INTERACTIVE ENTERTAINMENT NETWORK EUROPE LIMITED.

I can write the rule to match the file, but I am having trouble getting the text SONY INTERACTIVE ENTERTAINMENT NETWORK EUROPE LIMITED matched so I can use it in my rename rule.

I have a rule that matches:
Contents contains match "Receipt for your payment to "
Then if I use [abc] or [ab12%?] it will match only SONY. If I use [...] it seems to match the entire rest of the email.

How can I match from "Receipt for your payment to " to the end of the line?
Rug664
 
Posts: 8
Joined: Sun Aug 18, 2013 7:20 am

Re: Matching a sentence Wed Jan 31, 2018 12:25 pm • by Mr_Noodle
Try Hazel's preview function. There you can see the text as Hazel does. It may be the case where the email does not have an end of line where you think it does.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Matching a sentence Wed Jan 31, 2018 4:37 pm • by Rug664
Thanks. I have used preview and I can get a match, but I don't know how I can use the matching tokens to match what I want. It seems I cam match a word, or I can match anything. Can I match to and end of line?
Rug664
 
Posts: 8
Joined: Sun Aug 18, 2013 7:20 am

Re: Matching a sentence Thu Feb 01, 2018 11:26 am • by Mr_Noodle
If you use the "anything" token, that matches everything to the end of line. Again, though, you need to make sure the end of line is what you expect as the actual text in the document may not reflect what you see.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron