pattern for even number of HEX digits using Nick Gammon's Regexp library

westfw:
"Now you have two problems."

As I pointed out earlier, the whole "([A-F0-9][A-F0-9])+$" doesn't actually reject odd numbers of hex digits, as long as there are two digits at the end of the string ("ABC" still matches because it has "BC" at the end.)

That is not the whole story; it depends on what in the regex comes before the "([A-F0-9][A-F0-9])+" . As you are obviously aware, the '$' anchors the regex so that it matches to the end of the input but one can if necessary also anchor it to the front of the input using the '^' (followed by any desired regex prefix).

The problem I see with the OPs test is that the correct regex expects a space after the ';' but his test data does not have one. The faulty regex does not expect that space so passes. This is trivial to fix by allowing an optional space (or number of spaces) after the ';'.