Regex: In a character class, a dash doesn't need to be escaped if it's the last entry in the list. Also, $key is already uppercase, so there's no need to use the case-insensitive flag.