I think the generate_address_regex() function is broken. Looks like &b58[p] is calculated incorrectly.
I stuck a printf right before output_match() is called:
./vanitygen -r 1.{26}XX
Before output_match: 1H6d1q8niPVvci5zGnpbTkRfaBhWhWSXX5
After output_match: 1H6d1q8niPVvci5zGnpbTkRfaBhWhXcbEn
The address that the regex is being compared to is never a valid address, and the (valid) end address always differs in the last few characters.
Took me the longest time to figure out this was why all my regexes with $ in it behaved ... unexpectedly.