Use simpler regexes in case statement