--- id: 587d7db5367417b2b2512b97 title: Match Numbers and Letters of the Alphabet challengeType: 1 videoUrl: '' localeTitle: 匹配数字和字母的字母 --- ## Description
使用连字符( - )匹配一系列字符不仅限于字母。它也适用于匹配一系列数字。例如, /[0-5]/匹配05之间的任何数字,包括05 。此外,可以在单个字符集中组合一系列字母和数字。
让jennyStr =“Jenny8675309”;
让myRegex = / [a-z0-9] / ig;
//匹配jennyStr中的所有字母和数字
jennyStr.match(myRegex);
## Instructions
创建一个与hs之间的字母范围匹配的正则表达式,以及介于26之间的数字范围。请记住在正则表达式中包含适当的标志。
## Tests
```yml tests: - text: 你的正则表达式myRegex应该匹配17项。 testString: assert(result.length == 17); - text: 你的正则表达式myRegex应该使用全局标志。 testString: assert(myRegex.flags.match(/g/).length == 1); - text: 你的正则表达式myRegex应该使用不区分大小写的标志。 testString: assert(myRegex.flags.match(/i/).length == 1); ```
## Challenge Seed
```js let quoteSample = "Blueberry 3.141592653s are delicious."; let myRegex = /change/; // Change this line let result = myRegex; // Change this line ```
## Solution
```js // solution required ```