📅  最后修改于: 2022-03-11 15:01:21.040000             🧑  作者: Mango
//Detect Pangram
function isPangram(string){
// character set capturing group with negative lookahead
let regex = /([a-z])(?!.*\1)/gi;
return (string.match(regex)).length === 26;
}
console.log(isPangram("The quick brown fox jumps over the lazy dog."));// true
console.log(isPangram("This is not a pangram."));// false
console.log(isPangram("Pack my box with five dozen liquor jugs."));// true