update RegexUtil matches function