Cache the regex and remove logging.