--- title: Match All Letters and Numbers localeTitle: 匹配所有字母和数字 --- 问题 使用速记字符类\\ w来计算各种引号和字符串中的字母数字字符数。 解 让quoteSample =“五个拳击向导快速跳跃。”; 让alphabetRegexV2 = / \\ w / gi; //改变这一行 let result = quoteSample.match(alphabetRegexV2).length; ## 匹配所有字母和数字 这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/javascript-algorithms-and-data-structures/regular-expressions/match-all-letters-and-numbers/index.md) 。 [这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。