be less redundant with case statement regexes