Added optimize flag for regex.