Combine PDFs

I'm trying to come up with a Hazel rule that will do the following:
1.) Check for files that begin with a certain pattern (######w, where the # are numerical characters and the w is an actual w), and where a Mavericks tag does not exist.
2.) Check to see if a PDF matching the particular ######w pattern exists. (e.g. "010614w Expense Report Receipts.pdf") If it does not create it by copying this PDF file, if it does append this PDF file to it.
3.) Update a Mavericks tag on the original file to indicate it has been processed.
Any suggestions? The pattern matching and target file detection are what's throwing me for a loop.
Thanks,
Jeff
1.) Check for files that begin with a certain pattern (######w, where the # are numerical characters and the w is an actual w), and where a Mavericks tag does not exist.
2.) Check to see if a PDF matching the particular ######w pattern exists. (e.g. "010614w Expense Report Receipts.pdf") If it does not create it by copying this PDF file, if it does append this PDF file to it.
3.) Update a Mavericks tag on the original file to indicate it has been processed.
Any suggestions? The pattern matching and target file detection are what's throwing me for a loop.
Thanks,
Jeff