Note that to try every combination of five cards from seven means trying 21 combinations, which isn't so bad.
For each of the hands, #: where # is a number indicates the # jokers in hand case.
Also note that once you've found a hand, you don't have to look for hands that are worse than that in any of the other combinations out of seven cards - you can stop early.
You can form a straight flush if:
0: All of the cards are the same suit and the highest and lowest card have a difference of 4 (which implies the other three cards must be in between those)
1: All of the non-jokers are the same suit and the highest and lowest card have a difference of 4 or 3. (which implies the other cards fill in the straight, with one gap - which the joker fills)
2: All of the non-jokers are the same suit and the highest and lowest card have a difference of 4, 3 or 2.
3: All of the non-jokers are the same suit and the highest and lowest card have a difference of 4, 3, 2 or 1.
You can form a four of a kind if:
0: You have four cards the same rank.
1: You have three cards the same rank.
2: You have two cards the same rank.
3: You have a four of a kind - stop evaluating.
You can form a full house if:
0: You have a three of a kind and a pair.
1: You have a three of a kind, or you have two pairs.
2: You have a three of a kind, or you have a pair.
You can form a flush if:
All non-jokers are the same suit.
You can form a straight if:
See straight flush logic but take away the flush requirement.
You can form a three of a kind if:
0: You have three cards the same rank.
1: You have two cards the same rank.
2: You have a three of a kind - stop evaluating.
You can form a two pair if:
0: You have two cards the same rank, for two different ranks.
1: You have two cards the same rank (one pair).
You can form a pair if:
0: You have two cards the same rank.
1: You have a pair - stop evaluating.
You have highest card - stop evaluating