Match PDF against list, add all matches to comments

I'm matching the contents of PDFs against a list in a text file, and would like to write matches to Comments. The text file contains names. I can match against the list just fine, but Hazel only writes the first name, e.g. if the list contains John, Peter and Matt, Hazel only adds John if John and Peter are found in the PDF. I want Hazel to write all matches to Comments, not just the first one. Is there a way I can do this?