I have something else that is probably common knowledge: if you can
avoid using regular expressions, do it.  By replacing the regex matches
in my script with string operations, I increased the runtime speed by a
factor of ~4.