Would you mind pre-compiling/caching this regex above and outside this function so we don't have to rebuild it per request?