MySQL - Dumping 1TB database with SED to replace definer
First, dump only the routines, not any of the data.  That way it should be quite fast -- drop a routine, rebuild it.  Rinse, repeat.
As for the regexp, the format should be very regular, so [ ]* (or \s* can probably be simplified to  .
[^*]* --&gt;  .*\*

With some guts, simply
mysqldump ... | set -e '...' | mysql ...

I'm not clear that the regexp does the right thing; please provide a sample.