Kristofer Koishigawa b3213fc892 fix(i18n): chinese test suite (#38220)
* fix: Chinese test suite

Add localeTiltes, descriptions, and adjust test text and testStrings to get the automated test suite working.

* fix: ran script, updated testStrings and solutions
2020-03-03 18:49:47 +05:30

1.7 KiB
Raw Blame History

id, title, challengeType, videoUrl, localeTitle
id title challengeType videoUrl localeTitle
587d7db5367417b2b2512b97 Match Numbers and Letters of the Alphabet 1 匹配数字和字母的字母

Description

使用连字符( - )匹配一系列字符不仅限于字母。它也适用于匹配一系列数字。例如, /[0-5]/匹配05之间的任何数字,包括05 。此外,可以在单个字符集中组合一系列字母和数字。
让jennyStr =“Jenny8675309”;
让myRegex = / [a-z0-9] / ig;
//匹配jennyStr中的所有字母和数字
jennyStr.matchmyRegex;

Instructions

创建一个与hs之间的字母范围匹配的正则表达式,以及介于26之间的数字范围。请记住在正则表达式中包含适当的标志。

Tests

tests:
  - text: 你的正则表达式<code>myRegex</code>应该匹配17项。
    testString: assert(result.length == 17);
  - text: 你的正则表达式<code>myRegex</code>应该使用全局标志。
    testString: assert(myRegex.flags.match(/g/).length == 1);
  - text: 你的正则表达式<code>myRegex</code>应该使用不区分大小写的标志。
    testString: assert(myRegex.flags.match(/i/).length == 1);

Challenge Seed

let quoteSample = "Blueberry 3.141592653s are delicious.";
let myRegex = /change/; // Change this line
let result = myRegex; // Change this line

Solution

// solution required