If the regex is hardcoded, it would be more efficient to compile it only once.