Simplify returning errors, add warn() and fail()
Put the function return type above it's name
Make run_regex function static

The are no external calls to it and it is not specified in the header.