make sure to compile the regex once.