I think that the easy solution to this is to run the command with a cheap model in a sub agent that is going to detect the relevant information and raise it to the main context.
I think claude code is already doing this.
Trying to find the perfect set of regex that will cover all the edge cases for all the programs+versions is quite a task.