if ($month =~ /$user_month/ || $day =~ /$user_day/ || $year =~ /$user_year$/) { # The regex says: if the excel month contains the # user's entry for month, or the day contains the # user's entry for the day, or the year ends in the # the number that the user entered for year, then # go ahead and count that as a match. Unless you # give the exact criteria, I can't come up w/the # regex. There are a million possibilities. This one # ,for example, would NOT match if the user didn't # enter a month or day, but entered the exact year. # Which is probably not what you want. It would also # match too many things. (e.g. if the user entered '1' # for month, it would match 10, 11, 12, 01, etc.). # Let me know the criteria, and I can come up with the # correct regex. }