Replace regexes with CompCore Patterns class