In particular fix the regex magic to be tolerant of different ways
of formatting a main program.
My past life had forgotten this magic 14 years ago when we converted
it to just a table of commands in the forks.
https://www.youtube.com/watch?v=mWbbjvYmN8A
Reviewed-by: Saša Nedvědický <sashan@openssl.org> Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29241)