pre-compile regex patterns