Move regex out of critical path