is it possible to tell hazel to stop if a condition occurs?

Hi, I'm able to instruct hazel to get the invoice number inside a file.pdf
unfortunately hazel, who's searching for numbers, get, sometimes, even the near/sequent date of the invoice. cause the date of the invoice has ever the same pattern (01-01-19) is there a way to stop hazel just before it reach the date of the invoice?
ciao from italy
-marco

ciao from italy
-marco