📜  js 检查 pangram 的字符串 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:21.040000             🧑  作者: Mango

代码示例1
//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