Fix two prediffs to work on all OSes

The stock sed on darwin is not GNU or even a modern BSD version and you
can not write an extend regex command that works in both. I've changed
the scripts to be python which will work the same on all the platforms
we support.