正则匹配三种情况。
function detectCapitalUse(word: string): boolean { return !!word.match(/^[A-Z]+$|^[A-Z][a-z]*$|^[a-z]+$/) }