check the regex for matches