handle 3 types of match (including non-regex)