Renaming filename according to search result

I have some receipts both in text and pdf form. What I'd like to do is find a way for Hazel to look in the document, retrieve a certain date (typically the payout date) and then use this date as part of the files naming convention.
Is this possible anyway (scripting included)?
Thanks
Gup
Is this possible anyway (scripting included)?
Thanks
Gup