chore(i18n,curriculum): update translations (#43746)

This commit is contained in:
camperbot
2021-10-06 08:36:48 -07:00
committed by GitHub
parent c8d7f0a782
commit e6b3c90983
58 changed files with 284 additions and 14 deletions

View File

@ -14,7 +14,7 @@ dashedName: build-a-product-landing-page
你可以使用 HTML、JavaScript 以及 CSS 來完成項目。 由於目前你只學到了 CSS 課程,所以我們建議你只使用 CSS 來完成這個項目,同時鞏固一下你之前所學的內容。 你也可以使用 Bootstrap 或者 SASS。 我們不推薦你在這個項目中使用其他技術(比如 jQuery、React、Angular 或 Vue。 在後續的其他項目中,你將有機會使用像是 React 等其他技術棧。 我們會接受並嘗試修復你在使用推薦技術棧創建項目時報告的問題。 祝你編碼愉快! 你可以使用 HTML、JavaScript 以及 CSS 來完成項目。 由於目前你只學到了 CSS 課程,所以我們建議你只使用 CSS 來完成這個項目,同時鞏固一下你之前所學的內容。 你也可以使用 Bootstrap 或者 SASS。 我們不推薦你在這個項目中使用其他技術(比如 jQuery、React、Angular 或 Vue。 在後續的其他項目中,你將有機會使用像是 React 等其他技術棧。 我們會接受並嘗試修復你在使用推薦技術棧創建項目時報告的問題。 祝你編碼愉快!
**需求 1** 產品登頁應存在 `id="header"``header` 元素。 **需求 1** 產品登頁應存在 `id="header"``header` 元素。
**需求 2**`header` 元素內應存在 `id="header-img"` 的圖像, 這裏通常用來放置公司的 logo。 **需求 2**`header` 元素內應存在 `id="header-img"` 的圖像, 這裏通常用來放置公司的 logo。

View File

@ -69,12 +69,14 @@ assert(
你的正則表達式在`""`中不應該匹配到任何罪犯 你的正則表達式在`""`中不應該匹配到任何罪犯
```js ```js
reCriminals.lastIndex = 0;
assert(!reCriminals.test('')); assert(!reCriminals.test(''));
``` ```
你的正則表達式在`P1P2P3`中不應該匹配到任何罪犯 你的正則表達式在`P1P2P3`中不應該匹配到任何罪犯
```js ```js
reCriminals.lastIndex = 0;
assert(!reCriminals.test('P1P2P3')); assert(!reCriminals.test('P1P2P3'));
``` ```

View File

@ -23,60 +23,70 @@ dashedName: ignore-case-while-matching
你的正則表達式應該匹配 `freeCodeCamp` 你的正則表達式應該匹配 `freeCodeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('freeCodeCamp')); assert(fccRegex.test('freeCodeCamp'));
``` ```
你的正則表達式應該匹配 `FreeCodeCamp` 你的正則表達式應該匹配 `FreeCodeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreeCodeCamp')); assert(fccRegex.test('FreeCodeCamp'));
``` ```
你的正則表達式應該匹配 `FreecodeCamp` 你的正則表達式應該匹配 `FreecodeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreecodeCamp')); assert(fccRegex.test('FreecodeCamp'));
``` ```
你的正則表達式應該匹配 `FreeCodecamp` 你的正則表達式應該匹配 `FreeCodecamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreeCodecamp')); assert(fccRegex.test('FreeCodecamp'));
``` ```
你的正則表達式不應該匹配 `Free Code Camp` 你的正則表達式不應該匹配 `Free Code Camp`
```js ```js
fccRegex.lastIndex = 0;
assert(!fccRegex.test('Free Code Camp')); assert(!fccRegex.test('Free Code Camp'));
``` ```
您的正則表達式應該匹配字符串 `FreeCOdeCamp` 您的正則表達式應該匹配字符串 `FreeCOdeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreeCOdeCamp')); assert(fccRegex.test('FreeCOdeCamp'));
``` ```
你的正則表達式不應該匹配 `FCC` 你的正則表達式不應該匹配 `FCC`
```js ```js
fccRegex.lastIndex = 0;
assert(!fccRegex.test('FCC')); assert(!fccRegex.test('FCC'));
``` ```
你的正則表達式應該匹配字符串 `FrEeCoDeCamp` 你的正則表達式應該匹配字符串 `FrEeCoDeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FrEeCoDeCamp')); assert(fccRegex.test('FrEeCoDeCamp'));
``` ```
你的正則表達式應該匹配字符串 `FrEeCodECamp` 你的正則表達式應該匹配字符串 `FrEeCodECamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FrEeCodECamp')); assert(fccRegex.test('FrEeCodECamp'));
``` ```
你的正則表達式應該匹配字符串 `FReeCodeCAmp` 你的正則表達式應該匹配字符串 `FReeCodeCAmp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FReeCodeCAmp')); assert(fccRegex.test('FReeCodeCAmp'));
``` ```

View File

@ -25,42 +25,49 @@ dashedName: match-a-literal-string-with-different-possibilities
對於字符串 `John has a pet dog.`,你的正則表達式`petRegex` 應該返回 `true` 對於字符串 `John has a pet dog.`,你的正則表達式`petRegex` 應該返回 `true`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('John has a pet dog.')); assert(petRegex.test('John has a pet dog.'));
``` ```
對於字符串 `Emma has a pet rock.`,你的正則表達式 `petRegex` 的應該返回 `false` 對於字符串 `Emma has a pet rock.`,你的正則表達式 `petRegex` 的應該返回 `false`
```js ```js
petRegex.lastIndex = 0;
assert(!petRegex.test('Emma has a pet rock.')); assert(!petRegex.test('Emma has a pet rock.'));
``` ```
對於字符串 `Emma has a pet bird.`,你的正則表達式 `petRegex` 應該返回 `true` 對於字符串 `Emma has a pet bird.`,你的正則表達式 `petRegex` 應該返回 `true`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('Emma has a pet bird.')); assert(petRegex.test('Emma has a pet bird.'));
``` ```
對於字符串 `Liz has a pet cat.`,你的正則表達式 `petRegex` 應該返回 `true` 對於字符串 `Liz has a pet cat.`,你的正則表達式 `petRegex` 應該返回 `true`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('Liz has a pet cat.')); assert(petRegex.test('Liz has a pet cat.'));
``` ```
對於字符串 `Kara has a pet dolphin.`,你的正則表達式 `petRegex` 應該返回 `false` 對於字符串 `Kara has a pet dolphin.`,你的正則表達式 `petRegex` 應該返回 `false`
```js ```js
petRegex.lastIndex = 0;
assert(!petRegex.test('Kara has a pet dolphin.')); assert(!petRegex.test('Kara has a pet dolphin.'));
``` ```
對於字符串 `Alice has a pet fish.`,你的正則表達式 `petRegex` 應該返回 `true` 對於字符串 `Alice has a pet fish.`,你的正則表達式 `petRegex` 應該返回 `true`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('Alice has a pet fish.')); assert(petRegex.test('Alice has a pet fish.'));
``` ```
對於字符串 `Jimmy has a pet computer.`,你的正則表達式 `petRegex` 應該返回 `false` 對於字符串 `Jimmy has a pet computer.`,你的正則表達式 `petRegex` 應該返回 `false`
```js ```js
petRegex.lastIndex = 0;
assert(!petRegex.test('Jimmy has a pet computer.')); assert(!petRegex.test('Jimmy has a pet computer.'));
``` ```

View File

@ -43,12 +43,14 @@ assert(calRegex.flags == '');
你的正則表達式應該匹配字符串 `Cal` 的開始位置。 你的正則表達式應該匹配字符串 `Cal` 的開始位置。
```js ```js
calRegex.lastIndex = 0;
assert(calRegex.test('Cal and Ricky both like racing.')); assert(calRegex.test('Cal and Ricky both like racing.'));
``` ```
你的正則表達式不應該匹配中間包含 `Cal` 的字符串。 你的正則表達式不應該匹配中間包含 `Cal` 的字符串。
```js ```js
calRegex.lastIndex = 0;
assert(!calRegex.test('Ricky and Cal both like racing.')); assert(!calRegex.test('Ricky and Cal both like racing.'));
``` ```

View File

@ -43,6 +43,7 @@ assert(lastRegex.flags == '');
你應該在字符串 `The last car on a train is the caboose` 的末尾匹配 `caboose` 你應該在字符串 `The last car on a train is the caboose` 的末尾匹配 `caboose`
```js ```js
lastRegex.lastIndex = 0;
assert(lastRegex.test('The last car on a train is the caboose')); assert(lastRegex.test('The last car on a train is the caboose'));
``` ```

View File

@ -38,12 +38,14 @@ wrongRegex.test(testStr);
你的正則表達式 `waldoRegex` 應該匹配到 `Waldo` 你的正則表達式 `waldoRegex` 應該匹配到 `Waldo`
```js ```js
waldoRegex.lastIndex = 0;
assert(waldoRegex.test(waldoIsHiding)); assert(waldoRegex.test(waldoIsHiding));
``` ```
你的正則表達式 `waldoRegex` 不應該搜尋其他的任何內容。 你的正則表達式 `waldoRegex` 不應該搜尋其他的任何內容。
```js ```js
waldoRegex.lastIndex = 0;
assert(!waldoRegex.test('Somewhere is hiding in this text.')); assert(!waldoRegex.test('Somewhere is hiding in this text.'));
``` ```

View File

@ -52,48 +52,56 @@ assert(pwRegex.source.match(/\(\?=.*?\)\(\?=.*?\)/) !== null);
您的正則表達式不應匹配字符串 `astronaut` 您的正則表達式不應匹配字符串 `astronaut`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('astronaut')); assert(!pwRegex.test('astronaut'));
``` ```
你的正則表達式不應匹配字符串 `banan1` 你的正則表達式不應匹配字符串 `banan1`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('banan1')); assert(!pwRegex.test('banan1'));
``` ```
你的正則表達式應該匹配字符串 `bana12` 你的正則表達式應該匹配字符串 `bana12`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('bana12')); assert(pwRegex.test('bana12'));
``` ```
你的正則表達式應該匹配字符串 `abc123` 你的正則表達式應該匹配字符串 `abc123`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('abc123')); assert(pwRegex.test('abc123'));
``` ```
你的正則表達式不應匹配字符串 `12345` 你的正則表達式不應匹配字符串 `12345`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('12345')); assert(!pwRegex.test('12345'));
``` ```
你的正則表達式應該匹配字符串 `8pass99` 你的正則表達式應該匹配字符串 `8pass99`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('8pass99')); assert(pwRegex.test('8pass99'));
``` ```
你的正表達式不應匹配字符串 `1a2bcde` 你的正表達式不應匹配字符串 `1a2bcde`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('1a2bcde')); assert(!pwRegex.test('1a2bcde'));
``` ```
你的正則表達式應該匹配字符串 `astr1on11aut` 你的正則表達式應該匹配字符串 `astr1on11aut`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('astr1on11aut')); assert(pwRegex.test('astr1on11aut'));
``` ```

View File

@ -29,78 +29,91 @@ dashedName: restrict-possible-usernames
你的正則表達式應該匹配字符串 `JACK` 你的正則表達式應該匹配字符串 `JACK`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('JACK')); assert(userCheck.test('JACK'));
``` ```
你的正則表達式不應匹配字符串 `J` 你的正則表達式不應匹配字符串 `J`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('J')); assert(!userCheck.test('J'));
``` ```
你的正則表達式應該匹配字符串 `Jo` 你的正則表達式應該匹配字符串 `Jo`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('Jo')); assert(userCheck.test('Jo'));
``` ```
你的正則表達式應該匹配字符串 `Oceans11` 你的正則表達式應該匹配字符串 `Oceans11`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('Oceans11')); assert(userCheck.test('Oceans11'));
``` ```
你的正則表達式應該匹配字符串 `RegexGuru` 你的正則表達式應該匹配字符串 `RegexGuru`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('RegexGuru')); assert(userCheck.test('RegexGuru'));
``` ```
你的正則表達式不應匹配字符串 `007` 你的正則表達式不應匹配字符串 `007`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('007')); assert(!userCheck.test('007'));
``` ```
你的正則表達式不應匹配字符串 `9` 你的正則表達式不應匹配字符串 `9`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('9')); assert(!userCheck.test('9'));
``` ```
你的正則表達式不應匹配字符串 `A1` 你的正則表達式不應匹配字符串 `A1`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('A1')); assert(!userCheck.test('A1'));
``` ```
你的正則表達式不應匹配字符串 `BadUs3rnam3` 你的正則表達式不應匹配字符串 `BadUs3rnam3`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('BadUs3rnam3')); assert(!userCheck.test('BadUs3rnam3'));
``` ```
你的正則表達式應該匹配字符串 `Z97` 你的正則表達式應該匹配字符串 `Z97`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('Z97')); assert(userCheck.test('Z97'));
``` ```
你的正則表達式不應匹配字符串 `c57bT3` 你的正則表達式不應匹配字符串 `c57bT3`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('c57bT3')); assert(!userCheck.test('c57bT3'));
``` ```
你的正則表達式應該匹配字符串 `AB1` 你的正則表達式應該匹配字符串 `AB1`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('AB1')); assert(userCheck.test('AB1'));
``` ```
你的正則表達式不應匹配字符串 `J%4` 你的正則表達式不應匹配字符串 `J%4`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('J%4')) assert(!userCheck.test('J%4'))
``` ```

View File

@ -52,12 +52,14 @@ assert(reRegex.source.match(/\\1|\\2/g).length >= 2);
你的正則表達式應該匹配字符串 `42 42 42` 你的正則表達式應該匹配字符串 `42 42 42`
```js ```js
reRegex.lastIndex = 0;
assert(reRegex.test('42 42 42')); assert(reRegex.test('42 42 42'));
``` ```
你的正則表達式應該匹配字符串 `100 100 100` 你的正則表達式應該匹配字符串 `100 100 100`
```js ```js
reRegex.lastIndex = 0;
assert(reRegex.test('100 100 100')); assert(reRegex.test('100 100 100'));
``` ```
@ -76,18 +78,21 @@ assert.equal('42 42'.match(reRegex.source), null);
你的正則表達式不應該匹配字符串 `101 102 103` 你的正則表達式不應該匹配字符串 `101 102 103`
```js ```js
reRegex.lastIndex = 0;
assert(!reRegex.test('101 102 103')); assert(!reRegex.test('101 102 103'));
``` ```
你的正則表達式不應匹配字符串 `1 2 3` 你的正則表達式不應匹配字符串 `1 2 3`
```js ```js
reRegex.lastIndex = 0;
assert(!reRegex.test('1 2 3')); assert(!reRegex.test('1 2 3'));
``` ```
你的正則表達式不應匹配字符串 `10 10 10` 你的正則表達式不應匹配字符串 `10 10 10`
```js ```js
reRegex.lastIndex = 0;
assert(reRegex.test('10 10 10')); assert(reRegex.test('10 10 10'));
``` ```

View File

@ -41,12 +41,14 @@ assert(haRegex.source.match(/{.*?}/).length > 0);
你的正則表達式不應匹配字符串 `Hazzah` 你的正則表達式不應匹配字符串 `Hazzah`
```js ```js
haRegex.lastIndex = 0;
assert(!haRegex.test('Hazzah')); assert(!haRegex.test('Hazzah'));
``` ```
你的正則表達式不應匹配字符串 `Hazzzah` 你的正則表達式不應匹配字符串 `Hazzzah`
```js ```js
haRegex.lastIndex = 0;
assert(!haRegex.test('Hazzzah')); assert(!haRegex.test('Hazzzah'));
``` ```

View File

@ -39,6 +39,7 @@ assert(ohRegex.source.match(/{.*?}/).length > 0);
你的正則表達式不應匹配字符串 `Ohh no` 你的正則表達式不應匹配字符串 `Ohh no`
```js ```js
ohRegex.lastIndex = 0;
assert(!ohRegex.test('Ohh no')); assert(!ohRegex.test('Ohh no'));
``` ```
@ -69,6 +70,7 @@ assert('Ohhhhhh no'.match(ohRegex)[0].length === 10);
你的正則表達式應該匹配字符串 `Ohhhhhhh no` 你的正則表達式應該匹配字符串 `Ohhhhhhh no`
```js ```js
ohRegex.lastIndex = 0;
assert(!ohRegex.test('Ohhhhhhh no')); assert(!ohRegex.test('Ohhhhhhh no'));
``` ```

View File

@ -14,7 +14,7 @@ dashedName: build-a-product-landing-page
你可以使用 HTML、JavaScript 以及 CSS 来完成项目。 由于目前你只学到了 CSS 课程,所以我们建议你只使用 CSS 来完成这个项目,同时巩固一下你之前所学的内容。 你也可以使用 Bootstrap 或者 SASS。 我们不推荐你在这个项目中使用其他技术(比如 jQuery、React、Angular 或 Vue。 在后续的其他项目中,你将有机会使用像是 React 等其他技术栈。 我们会接受并尝试修复你在使用推荐技术栈创建项目时报告的问题。 祝你编码愉快! 你可以使用 HTML、JavaScript 以及 CSS 来完成项目。 由于目前你只学到了 CSS 课程,所以我们建议你只使用 CSS 来完成这个项目,同时巩固一下你之前所学的内容。 你也可以使用 Bootstrap 或者 SASS。 我们不推荐你在这个项目中使用其他技术(比如 jQuery、React、Angular 或 Vue。 在后续的其他项目中,你将有机会使用像是 React 等其他技术栈。 我们会接受并尝试修复你在使用推荐技术栈创建项目时报告的问题。 祝你编码愉快!
**需求 1** 产品登页应存在 `id="header"``header` 元素。 **需求 1** 产品登页应存在 `id="header"``header` 元素。
**需求 2**`header` 元素内应存在 `id="header-img"` 的图像, 这里通常用来放置公司的 logo。 **需求 2**`header` 元素内应存在 `id="header-img"` 的图像, 这里通常用来放置公司的 logo。

View File

@ -69,12 +69,14 @@ assert(
你的正则表达式在`""`中不应该匹配到任何罪犯 你的正则表达式在`""`中不应该匹配到任何罪犯
```js ```js
reCriminals.lastIndex = 0;
assert(!reCriminals.test('')); assert(!reCriminals.test(''));
``` ```
你的正则表达式在`P1P2P3`中不应该匹配到任何罪犯 你的正则表达式在`P1P2P3`中不应该匹配到任何罪犯
```js ```js
reCriminals.lastIndex = 0;
assert(!reCriminals.test('P1P2P3')); assert(!reCriminals.test('P1P2P3'));
``` ```

View File

@ -23,60 +23,70 @@ dashedName: ignore-case-while-matching
你的正则表达式应该匹配 `freeCodeCamp` 你的正则表达式应该匹配 `freeCodeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('freeCodeCamp')); assert(fccRegex.test('freeCodeCamp'));
``` ```
你的正则表达式应该匹配 `FreeCodeCamp` 你的正则表达式应该匹配 `FreeCodeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreeCodeCamp')); assert(fccRegex.test('FreeCodeCamp'));
``` ```
你的正则表达式应该匹配 `FreecodeCamp` 你的正则表达式应该匹配 `FreecodeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreecodeCamp')); assert(fccRegex.test('FreecodeCamp'));
``` ```
你的正则表达式应该匹配 `FreeCodecamp` 你的正则表达式应该匹配 `FreeCodecamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreeCodecamp')); assert(fccRegex.test('FreeCodecamp'));
``` ```
你的正则表达式不应该匹配 `Free Code Camp` 你的正则表达式不应该匹配 `Free Code Camp`
```js ```js
fccRegex.lastIndex = 0;
assert(!fccRegex.test('Free Code Camp')); assert(!fccRegex.test('Free Code Camp'));
``` ```
您的正则表达式应该匹配字符串 `FreeCOdeCamp` 您的正则表达式应该匹配字符串 `FreeCOdeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreeCOdeCamp')); assert(fccRegex.test('FreeCOdeCamp'));
``` ```
你的正则表达式不应该匹配 `FCC` 你的正则表达式不应该匹配 `FCC`
```js ```js
fccRegex.lastIndex = 0;
assert(!fccRegex.test('FCC')); assert(!fccRegex.test('FCC'));
``` ```
你的正则表达式应该匹配字符串 `FrEeCoDeCamp` 你的正则表达式应该匹配字符串 `FrEeCoDeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FrEeCoDeCamp')); assert(fccRegex.test('FrEeCoDeCamp'));
``` ```
你的正则表达式应该匹配字符串 `FrEeCodECamp` 你的正则表达式应该匹配字符串 `FrEeCodECamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FrEeCodECamp')); assert(fccRegex.test('FrEeCodECamp'));
``` ```
你的正则表达式应该匹配字符串 `FReeCodeCAmp` 你的正则表达式应该匹配字符串 `FReeCodeCAmp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FReeCodeCAmp')); assert(fccRegex.test('FReeCodeCAmp'));
``` ```

View File

@ -25,42 +25,49 @@ dashedName: match-a-literal-string-with-different-possibilities
对于字符串 `John has a pet dog.`,你的正则表达式`petRegex` 应该返回 `true` 对于字符串 `John has a pet dog.`,你的正则表达式`petRegex` 应该返回 `true`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('John has a pet dog.')); assert(petRegex.test('John has a pet dog.'));
``` ```
对于字符串 `Emma has a pet rock.`,你的正则表达式 `petRegex` 的应该返回 `false` 对于字符串 `Emma has a pet rock.`,你的正则表达式 `petRegex` 的应该返回 `false`
```js ```js
petRegex.lastIndex = 0;
assert(!petRegex.test('Emma has a pet rock.')); assert(!petRegex.test('Emma has a pet rock.'));
``` ```
对于字符串 `Emma has a pet bird.`,你的正则表达式 `petRegex` 应该返回 `true` 对于字符串 `Emma has a pet bird.`,你的正则表达式 `petRegex` 应该返回 `true`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('Emma has a pet bird.')); assert(petRegex.test('Emma has a pet bird.'));
``` ```
对于字符串 `Liz has a pet cat.`,你的正则表达式 `petRegex` 应该返回 `true` 对于字符串 `Liz has a pet cat.`,你的正则表达式 `petRegex` 应该返回 `true`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('Liz has a pet cat.')); assert(petRegex.test('Liz has a pet cat.'));
``` ```
对于字符串 `Kara has a pet dolphin.`,你的正则表达式 `petRegex` 应该返回 `false` 对于字符串 `Kara has a pet dolphin.`,你的正则表达式 `petRegex` 应该返回 `false`
```js ```js
petRegex.lastIndex = 0;
assert(!petRegex.test('Kara has a pet dolphin.')); assert(!petRegex.test('Kara has a pet dolphin.'));
``` ```
对于字符串 `Alice has a pet fish.`,你的正则表达式 `petRegex` 应该返回 `true` 对于字符串 `Alice has a pet fish.`,你的正则表达式 `petRegex` 应该返回 `true`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('Alice has a pet fish.')); assert(petRegex.test('Alice has a pet fish.'));
``` ```
对于字符串 `Jimmy has a pet computer.`,你的正则表达式 `petRegex` 应该返回 `false` 对于字符串 `Jimmy has a pet computer.`,你的正则表达式 `petRegex` 应该返回 `false`
```js ```js
petRegex.lastIndex = 0;
assert(!petRegex.test('Jimmy has a pet computer.')); assert(!petRegex.test('Jimmy has a pet computer.'));
``` ```

View File

@ -43,12 +43,14 @@ assert(calRegex.flags == '');
你的正则表达式应该匹配字符串 `Cal` 的开始位置。 你的正则表达式应该匹配字符串 `Cal` 的开始位置。
```js ```js
calRegex.lastIndex = 0;
assert(calRegex.test('Cal and Ricky both like racing.')); assert(calRegex.test('Cal and Ricky both like racing.'));
``` ```
你的正则表达式不应该匹配中间包含 `Cal` 的字符串。 你的正则表达式不应该匹配中间包含 `Cal` 的字符串。
```js ```js
calRegex.lastIndex = 0;
assert(!calRegex.test('Ricky and Cal both like racing.')); assert(!calRegex.test('Ricky and Cal both like racing.'));
``` ```

View File

@ -43,6 +43,7 @@ assert(lastRegex.flags == '');
你应该在字符串 `The last car on a train is the caboose` 的末尾匹配 `caboose` 你应该在字符串 `The last car on a train is the caboose` 的末尾匹配 `caboose`
```js ```js
lastRegex.lastIndex = 0;
assert(lastRegex.test('The last car on a train is the caboose')); assert(lastRegex.test('The last car on a train is the caboose'));
``` ```

View File

@ -38,12 +38,14 @@ wrongRegex.test(testStr);
你的正则表达式 `waldoRegex` 应该匹配到 `Waldo` 你的正则表达式 `waldoRegex` 应该匹配到 `Waldo`
```js ```js
waldoRegex.lastIndex = 0;
assert(waldoRegex.test(waldoIsHiding)); assert(waldoRegex.test(waldoIsHiding));
``` ```
你的正则表达式 `waldoRegex` 不应该搜寻其他的任何内容。 你的正则表达式 `waldoRegex` 不应该搜寻其他的任何内容。
```js ```js
waldoRegex.lastIndex = 0;
assert(!waldoRegex.test('Somewhere is hiding in this text.')); assert(!waldoRegex.test('Somewhere is hiding in this text.'));
``` ```

View File

@ -52,48 +52,56 @@ assert(pwRegex.source.match(/\(\?=.*?\)\(\?=.*?\)/) !== null);
您的正则表达式不应匹配字符串 `astronaut` 您的正则表达式不应匹配字符串 `astronaut`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('astronaut')); assert(!pwRegex.test('astronaut'));
``` ```
你的正则表达式不应匹配字符串 `banan1` 你的正则表达式不应匹配字符串 `banan1`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('banan1')); assert(!pwRegex.test('banan1'));
``` ```
你的正则表达式应该匹配字符串 `bana12` 你的正则表达式应该匹配字符串 `bana12`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('bana12')); assert(pwRegex.test('bana12'));
``` ```
你的正则表达式应该匹配字符串 `abc123` 你的正则表达式应该匹配字符串 `abc123`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('abc123')); assert(pwRegex.test('abc123'));
``` ```
你的正则表达式不应匹配字符串 `12345` 你的正则表达式不应匹配字符串 `12345`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('12345')); assert(!pwRegex.test('12345'));
``` ```
你的正则表达式应该匹配字符串 `8pass99` 你的正则表达式应该匹配字符串 `8pass99`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('8pass99')); assert(pwRegex.test('8pass99'));
``` ```
你的正表达式不应匹配字符串 `1a2bcde` 你的正表达式不应匹配字符串 `1a2bcde`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('1a2bcde')); assert(!pwRegex.test('1a2bcde'));
``` ```
你的正则表达式应该匹配字符串 `astr1on11aut` 你的正则表达式应该匹配字符串 `astr1on11aut`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('astr1on11aut')); assert(pwRegex.test('astr1on11aut'));
``` ```

View File

@ -29,78 +29,91 @@ dashedName: restrict-possible-usernames
你的正则表达式应该匹配字符串 `JACK` 你的正则表达式应该匹配字符串 `JACK`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('JACK')); assert(userCheck.test('JACK'));
``` ```
你的正则表达式不应匹配字符串 `J` 你的正则表达式不应匹配字符串 `J`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('J')); assert(!userCheck.test('J'));
``` ```
你的正则表达式应该匹配字符串 `Jo` 你的正则表达式应该匹配字符串 `Jo`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('Jo')); assert(userCheck.test('Jo'));
``` ```
你的正则表达式应该匹配字符串 `Oceans11` 你的正则表达式应该匹配字符串 `Oceans11`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('Oceans11')); assert(userCheck.test('Oceans11'));
``` ```
你的正则表达式应该匹配字符串 `RegexGuru` 你的正则表达式应该匹配字符串 `RegexGuru`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('RegexGuru')); assert(userCheck.test('RegexGuru'));
``` ```
你的正则表达式不应匹配字符串 `007` 你的正则表达式不应匹配字符串 `007`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('007')); assert(!userCheck.test('007'));
``` ```
你的正则表达式不应匹配字符串 `9` 你的正则表达式不应匹配字符串 `9`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('9')); assert(!userCheck.test('9'));
``` ```
你的正则表达式不应匹配字符串 `A1` 你的正则表达式不应匹配字符串 `A1`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('A1')); assert(!userCheck.test('A1'));
``` ```
你的正则表达式不应匹配字符串 `BadUs3rnam3` 你的正则表达式不应匹配字符串 `BadUs3rnam3`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('BadUs3rnam3')); assert(!userCheck.test('BadUs3rnam3'));
``` ```
你的正则表达式应该匹配字符串 `Z97` 你的正则表达式应该匹配字符串 `Z97`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('Z97')); assert(userCheck.test('Z97'));
``` ```
你的正则表达式不应匹配字符串 `c57bT3` 你的正则表达式不应匹配字符串 `c57bT3`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('c57bT3')); assert(!userCheck.test('c57bT3'));
``` ```
你的正则表达式应该匹配字符串 `AB1` 你的正则表达式应该匹配字符串 `AB1`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('AB1')); assert(userCheck.test('AB1'));
``` ```
你的正则表达式不应匹配字符串 `J%4` 你的正则表达式不应匹配字符串 `J%4`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('J%4')) assert(!userCheck.test('J%4'))
``` ```

View File

@ -52,12 +52,14 @@ assert(reRegex.source.match(/\\1|\\2/g).length >= 2);
你的正则表达式应该匹配字符串 `42 42 42` 你的正则表达式应该匹配字符串 `42 42 42`
```js ```js
reRegex.lastIndex = 0;
assert(reRegex.test('42 42 42')); assert(reRegex.test('42 42 42'));
``` ```
你的正则表达式应该匹配字符串 `100 100 100` 你的正则表达式应该匹配字符串 `100 100 100`
```js ```js
reRegex.lastIndex = 0;
assert(reRegex.test('100 100 100')); assert(reRegex.test('100 100 100'));
``` ```
@ -76,18 +78,21 @@ assert.equal('42 42'.match(reRegex.source), null);
你的正则表达式不应该匹配字符串 `101 102 103` 你的正则表达式不应该匹配字符串 `101 102 103`
```js ```js
reRegex.lastIndex = 0;
assert(!reRegex.test('101 102 103')); assert(!reRegex.test('101 102 103'));
``` ```
你的正则表达式不应匹配字符串 `1 2 3` 你的正则表达式不应匹配字符串 `1 2 3`
```js ```js
reRegex.lastIndex = 0;
assert(!reRegex.test('1 2 3')); assert(!reRegex.test('1 2 3'));
``` ```
你的正则表达式不应匹配字符串 `10 10 10` 你的正则表达式不应匹配字符串 `10 10 10`
```js ```js
reRegex.lastIndex = 0;
assert(reRegex.test('10 10 10')); assert(reRegex.test('10 10 10'));
``` ```

View File

@ -41,12 +41,14 @@ assert(haRegex.source.match(/{.*?}/).length > 0);
你的正则表达式不应匹配字符串 `Hazzah` 你的正则表达式不应匹配字符串 `Hazzah`
```js ```js
haRegex.lastIndex = 0;
assert(!haRegex.test('Hazzah')); assert(!haRegex.test('Hazzah'));
``` ```
你的正则表达式不应匹配字符串 `Hazzzah` 你的正则表达式不应匹配字符串 `Hazzzah`
```js ```js
haRegex.lastIndex = 0;
assert(!haRegex.test('Hazzzah')); assert(!haRegex.test('Hazzzah'));
``` ```

View File

@ -39,6 +39,7 @@ assert(ohRegex.source.match(/{.*?}/).length > 0);
你的正则表达式不应匹配字符串 `Ohh no` 你的正则表达式不应匹配字符串 `Ohh no`
```js ```js
ohRegex.lastIndex = 0;
assert(!ohRegex.test('Ohh no')); assert(!ohRegex.test('Ohh no'));
``` ```
@ -69,6 +70,7 @@ assert('Ohhhhhh no'.match(ohRegex)[0].length === 10);
你的正则表达式应该匹配字符串 `Ohhhhhhh no` 你的正则表达式应该匹配字符串 `Ohhhhhhh no`
```js ```js
ohRegex.lastIndex = 0;
assert(!ohRegex.test('Ohhhhhhh no')); assert(!ohRegex.test('Ohhhhhhh no'));
``` ```

View File

@ -69,12 +69,14 @@ assert(
Tu expresión regular no debe coincidir con ningún criminal en la cadena vacía `""` Tu expresión regular no debe coincidir con ningún criminal en la cadena vacía `""`
```js ```js
reCriminals.lastIndex = 0;
assert(!reCriminals.test('')); assert(!reCriminals.test(''));
``` ```
Tu regex no debe coincidir con ningún criminal en la cadena `P1P2P3` Tu regex no debe coincidir con ningún criminal en la cadena `P1P2P3`
```js ```js
reCriminals.lastIndex = 0;
assert(!reCriminals.test('P1P2P3')); assert(!reCriminals.test('P1P2P3'));
``` ```

View File

@ -23,60 +23,70 @@ Escribe una expresión regular `fccRegex` para que coincida con `freeCodeCamp` s
Tu expresión regular debe coincidir con la cadena `freeCodeCamp` Tu expresión regular debe coincidir con la cadena `freeCodeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('freeCodeCamp')); assert(fccRegex.test('freeCodeCamp'));
``` ```
Tu expresión regular debe coincidir con la cadena `FreeCodeCamp` Tu expresión regular debe coincidir con la cadena `FreeCodeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreeCodeCamp')); assert(fccRegex.test('FreeCodeCamp'));
``` ```
Tu expresión regular debe coincidir con la cadena `FreecodeCamp` Tu expresión regular debe coincidir con la cadena `FreecodeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreecodeCamp')); assert(fccRegex.test('FreecodeCamp'));
``` ```
Tu expresión regular debe coincidir con la cadena `FreeCodecamp` Tu expresión regular debe coincidir con la cadena `FreeCodecamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreeCodecamp')); assert(fccRegex.test('FreeCodecamp'));
``` ```
Tu expresión regular no debe coincidir con la cadena `Free Code Camp` Tu expresión regular no debe coincidir con la cadena `Free Code Camp`
```js ```js
fccRegex.lastIndex = 0;
assert(!fccRegex.test('Free Code Camp')); assert(!fccRegex.test('Free Code Camp'));
``` ```
Tu expresión regular debe coincidir con la cadena `FreeCOdeCamp` Tu expresión regular debe coincidir con la cadena `FreeCOdeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreeCOdeCamp')); assert(fccRegex.test('FreeCOdeCamp'));
``` ```
Tu expresión regular no debe coincidir con la cadena `FCC` Tu expresión regular no debe coincidir con la cadena `FCC`
```js ```js
fccRegex.lastIndex = 0;
assert(!fccRegex.test('FCC')); assert(!fccRegex.test('FCC'));
``` ```
Tu expresión regular debe coincidir con la cadena `FrEeCoDeCamp` Tu expresión regular debe coincidir con la cadena `FrEeCoDeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FrEeCoDeCamp')); assert(fccRegex.test('FrEeCoDeCamp'));
``` ```
Tu expresión regular debe coincidir con la cadena `FrEeCodECamp` Tu expresión regular debe coincidir con la cadena `FrEeCodECamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FrEeCodECamp')); assert(fccRegex.test('FrEeCodECamp'));
``` ```
Tu expresión regular debe coincidir con la cadena `FReeCodeCAmp` Tu expresión regular debe coincidir con la cadena `FReeCodeCAmp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FReeCodeCAmp')); assert(fccRegex.test('FReeCodeCAmp'));
``` ```

View File

@ -25,42 +25,49 @@ Completa la expresión regular `petRegex` para que coincida con las mascotas `do
Tu expresión regular `petRegex` debe devolver `true` para la cadena `John has a pet dog.` Tu expresión regular `petRegex` debe devolver `true` para la cadena `John has a pet dog.`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('John has a pet dog.')); assert(petRegex.test('John has a pet dog.'));
``` ```
Tu expresión regular `petRegex` debe devolver `false` para la cadena `Emma has a pet rock.` Tu expresión regular `petRegex` debe devolver `false` para la cadena `Emma has a pet rock.`
```js ```js
petRegex.lastIndex = 0;
assert(!petRegex.test('Emma has a pet rock.')); assert(!petRegex.test('Emma has a pet rock.'));
``` ```
Tu expresión regular `petRegex` debe devolver `true` para la cadena `Emma has a pet bird.` Tu expresión regular `petRegex` debe devolver `true` para la cadena `Emma has a pet bird.`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('Emma has a pet bird.')); assert(petRegex.test('Emma has a pet bird.'));
``` ```
Tu expresión regular `petRegex` debe devolver `true` para la cadena `Liz has a pet cat.` Tu expresión regular `petRegex` debe devolver `true` para la cadena `Liz has a pet cat.`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('Liz has a pet cat.')); assert(petRegex.test('Liz has a pet cat.'));
``` ```
Tu expresión regular `petRegex` debe devolver `false` para la cadena `Kara has a pet dolphin.` Tu expresión regular `petRegex` debe devolver `false` para la cadena `Kara has a pet dolphin.`
```js ```js
petRegex.lastIndex = 0;
assert(!petRegex.test('Kara has a pet dolphin.')); assert(!petRegex.test('Kara has a pet dolphin.'));
``` ```
Tu expresión regular `petRegex` debe devolver `true` para la cadena `Alice has a pet fish.` Tu expresión regular `petRegex` debe devolver `true` para la cadena `Alice has a pet fish.`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('Alice has a pet fish.')); assert(petRegex.test('Alice has a pet fish.'));
``` ```
Tu expresión regular `petRegex` debe devolver `false` para la cadena `Jimmy has a pet computer.` Tu expresión regular `petRegex` debe devolver `false` para la cadena `Jimmy has a pet computer.`
```js ```js
petRegex.lastIndex = 0;
assert(!petRegex.test('Jimmy has a pet computer.')); assert(!petRegex.test('Jimmy has a pet computer.'));
``` ```

View File

@ -43,12 +43,14 @@ assert(calRegex.flags == '');
Tu expresión regular debe coincidir con la cadena `Cal` en el inicio de la cadena. Tu expresión regular debe coincidir con la cadena `Cal` en el inicio de la cadena.
```js ```js
calRegex.lastIndex = 0;
assert(calRegex.test('Cal and Ricky both like racing.')); assert(calRegex.test('Cal and Ricky both like racing.'));
``` ```
Tu expresión regular debe coincidir con la cadena `Cal` en medio de la cadena. Tu expresión regular debe coincidir con la cadena `Cal` en medio de la cadena.
```js ```js
calRegex.lastIndex = 0;
assert(!calRegex.test('Ricky and Cal both like racing.')); assert(!calRegex.test('Ricky and Cal both like racing.'));
``` ```

View File

@ -43,6 +43,7 @@ assert(lastRegex.flags == '');
Debes coincidir `caboose` al final de la cadena `The last car on a train is the caboose` Debes coincidir `caboose` al final de la cadena `The last car on a train is the caboose`
```js ```js
lastRegex.lastIndex = 0;
assert(lastRegex.test('The last car on a train is the caboose')); assert(lastRegex.test('The last car on a train is the caboose'));
``` ```

View File

@ -38,12 +38,14 @@ Completa la expresión regular `waldoRegex` para encontrar `"Waldo"` en la caden
Tu expresión regular `waldoRegex` debe encontrar la cadena `Waldo` Tu expresión regular `waldoRegex` debe encontrar la cadena `Waldo`
```js ```js
waldoRegex.lastIndex = 0;
assert(waldoRegex.test(waldoIsHiding)); assert(waldoRegex.test(waldoIsHiding));
``` ```
Tu expresión regular `waldoRegex` no debe buscar ninguna otra cosa. Tu expresión regular `waldoRegex` no debe buscar ninguna otra cosa.
```js ```js
waldoRegex.lastIndex = 0;
assert(!waldoRegex.test('Somewhere is hiding in this text.')); assert(!waldoRegex.test('Somewhere is hiding in this text.'));
``` ```

View File

@ -52,48 +52,56 @@ assert(pwRegex.source.match(/\(\?=.*?\)\(\?=.*?\)/) !== null);
Tu expresión regular no debe coincidir con la cadena `astronaut` Tu expresión regular no debe coincidir con la cadena `astronaut`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('astronaut')); assert(!pwRegex.test('astronaut'));
``` ```
Tu expresión regular no debe coincidir con la cadena `banan1` Tu expresión regular no debe coincidir con la cadena `banan1`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('banan1')); assert(!pwRegex.test('banan1'));
``` ```
Tu expresión regular debe coincidir con la cadena `bana12` Tu expresión regular debe coincidir con la cadena `bana12`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('bana12')); assert(pwRegex.test('bana12'));
``` ```
Tu expresión regular debe coincidir con la cadena `abc123` Tu expresión regular debe coincidir con la cadena `abc123`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('abc123')); assert(pwRegex.test('abc123'));
``` ```
Tu expresión regular no debe coincidir con la cadena `12345` Tu expresión regular no debe coincidir con la cadena `12345`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('12345')); assert(!pwRegex.test('12345'));
``` ```
Tu expresión regular debe coincidir con la cadena `8pass99` Tu expresión regular debe coincidir con la cadena `8pass99`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('8pass99')); assert(pwRegex.test('8pass99'));
``` ```
Tu expresión regular no debe coincidir con la cadena `1a2bcde` Tu expresión regular no debe coincidir con la cadena `1a2bcde`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('1a2bcde')); assert(!pwRegex.test('1a2bcde'));
``` ```
Tu expresión regular debe coincidir con la cadena `astr1on11aut` Tu expresión regular debe coincidir con la cadena `astr1on11aut`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('astr1on11aut')); assert(pwRegex.test('astr1on11aut'));
``` ```

View File

@ -29,78 +29,91 @@ Cambia la expresión regular `userCheck` para que se ajuste a las restricciones
Tu expresión regular debe coincidir con la cadena `JACK` Tu expresión regular debe coincidir con la cadena `JACK`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('JACK')); assert(userCheck.test('JACK'));
``` ```
Tu expresión regular no debe coincidir con la cadena `J` Tu expresión regular no debe coincidir con la cadena `J`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('J')); assert(!userCheck.test('J'));
``` ```
Tu expresión regular debe coincidir con la cadena `Jo` Tu expresión regular debe coincidir con la cadena `Jo`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('Jo')); assert(userCheck.test('Jo'));
``` ```
Tu expresión regular debe coincidir con la cadena `Oceans11` Tu expresión regular debe coincidir con la cadena `Oceans11`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('Oceans11')); assert(userCheck.test('Oceans11'));
``` ```
Tu expresión regular debe coincidir con la cadena `RegexGuru` Tu expresión regular debe coincidir con la cadena `RegexGuru`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('RegexGuru')); assert(userCheck.test('RegexGuru'));
``` ```
Tu expresión regular no debe coincidir con la cadena `007` Tu expresión regular no debe coincidir con la cadena `007`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('007')); assert(!userCheck.test('007'));
``` ```
Tu expresión regular no debe coincidir con la cadena `9` Tu expresión regular no debe coincidir con la cadena `9`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('9')); assert(!userCheck.test('9'));
``` ```
Tu expresión regular no debe coincidir con la cadena `A1` Tu expresión regular no debe coincidir con la cadena `A1`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('A1')); assert(!userCheck.test('A1'));
``` ```
Tu expresión regular no debe coincidir con la cadena `BadUs3rnam3` Tu expresión regular no debe coincidir con la cadena `BadUs3rnam3`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('BadUs3rnam3')); assert(!userCheck.test('BadUs3rnam3'));
``` ```
Tu expresión regular debe coincidir con la cadena `Z97` Tu expresión regular debe coincidir con la cadena `Z97`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('Z97')); assert(userCheck.test('Z97'));
``` ```
Tu expresión regular no debe coincidir con la cadena `c57bT3` Tu expresión regular no debe coincidir con la cadena `c57bT3`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('c57bT3')); assert(!userCheck.test('c57bT3'));
``` ```
Tu expresión regular debe coincidir con la cadena `AB1` Tu expresión regular debe coincidir con la cadena `AB1`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('AB1')); assert(userCheck.test('AB1'));
``` ```
Tu expresión regular no debe coincidir con la cadena `J%4` Tu expresión regular no debe coincidir con la cadena `J%4`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('J%4')) assert(!userCheck.test('J%4'))
``` ```

View File

@ -52,12 +52,14 @@ assert(reRegex.source.match(/\\1|\\2/g).length >= 2);
Tu expresión regular debe coincidir con la cadena `42 42 42`. Tu expresión regular debe coincidir con la cadena `42 42 42`.
```js ```js
reRegex.lastIndex = 0;
assert(reRegex.test('42 42 42')); assert(reRegex.test('42 42 42'));
``` ```
Tu expresión regular debe coincidir con la cadena `100 100 100`. Tu expresión regular debe coincidir con la cadena `100 100 100`.
```js ```js
reRegex.lastIndex = 0;
assert(reRegex.test('100 100 100')); assert(reRegex.test('100 100 100'));
``` ```
@ -76,18 +78,21 @@ assert.equal('42 42'.match(reRegex.source), null);
Tu expresión regular no debe coincidir con la cadena `101 102 103`. Tu expresión regular no debe coincidir con la cadena `101 102 103`.
```js ```js
reRegex.lastIndex = 0;
assert(!reRegex.test('101 102 103')); assert(!reRegex.test('101 102 103'));
``` ```
Tu expresión regular no debe coincidir con la cadena `1 2 3`. Tu expresión regular no debe coincidir con la cadena `1 2 3`.
```js ```js
reRegex.lastIndex = 0;
assert(!reRegex.test('1 2 3')); assert(!reRegex.test('1 2 3'));
``` ```
Tu expresión regular debe coincidir con la cadena `10 10 10`. Tu expresión regular debe coincidir con la cadena `10 10 10`.
```js ```js
reRegex.lastIndex = 0;
assert(reRegex.test('10 10 10')); assert(reRegex.test('10 10 10'));
``` ```

View File

@ -41,12 +41,14 @@ assert(haRegex.source.match(/{.*?}/).length > 0);
La expresión regular no debe coincidir con la cadena `Hazzah` La expresión regular no debe coincidir con la cadena `Hazzah`
```js ```js
haRegex.lastIndex = 0;
assert(!haRegex.test('Hazzah')); assert(!haRegex.test('Hazzah'));
``` ```
La expresión regular no debe coincidir con la cadena `Hazzzah` La expresión regular no debe coincidir con la cadena `Hazzzah`
```js ```js
haRegex.lastIndex = 0;
assert(!haRegex.test('Hazzzah')); assert(!haRegex.test('Hazzzah'));
``` ```

View File

@ -39,6 +39,7 @@ assert(ohRegex.source.match(/{.*?}/).length > 0);
La expresión regular no debe coincidir con la cadena `Ohh no` La expresión regular no debe coincidir con la cadena `Ohh no`
```js ```js
ohRegex.lastIndex = 0;
assert(!ohRegex.test('Ohh no')); assert(!ohRegex.test('Ohh no'));
``` ```
@ -69,6 +70,7 @@ assert('Ohhhhhh no'.match(ohRegex)[0].length === 10);
La expresión regular no debe coincidir con la cadena `Ohhhhhhh no` La expresión regular no debe coincidir con la cadena `Ohhhhhhh no`
```js ```js
ohRegex.lastIndex = 0;
assert(!ohRegex.test('Ohhhhhhh no')); assert(!ohRegex.test('Ohhhhhhh no'));
``` ```

View File

@ -1,6 +1,6 @@
--- ---
id: 587d7fa8367417b2b2512bcc id: 587d7fa8367417b2b2512bcc
title: Display Shapes with SVG title: Mostrar formas con SVG
challengeType: 6 challengeType: 6
forumTopicId: 301485 forumTopicId: 301485
dashedName: display-shapes-with-svg dashedName: display-shapes-with-svg
@ -8,47 +8,47 @@ dashedName: display-shapes-with-svg
# --description-- # --description--
The last challenge created an `svg` element with a given width and height, which was visible because it had a `background-color` applied to it in the `style` tag. The code made space for the given width and height. El desafío anterior creó un elemento `svg` con un ancho y alto determinado, el cual era visible porque tenía un `background-color` aplicado a él en la etiqueta `style`. El código dejó espacio para el ancho y la altura dados.
The next step is to create a shape to put in the `svg` area. There are a number of supported shapes in SVG, such as rectangles and circles. They are used to display data. For example, a rectangle (`<rect>`) SVG shape could create a bar in a bar chart. El siguiente paso es crear una forma para poner en el área `svg`. Hay una serie de formas compatibles en SVG, como rectángulos y círculos. Se utilizan para mostrar datos. Por ejemplo, una forma SVG rectangular (`<rect>`) podría crear una barra en un gráfico de barras.
When you place a shape into the `svg` area, you can specify where it goes with `x` and `y` coordinates. The origin point of (0, 0) is in the upper-left corner. Positive values for `x` push the shape to the right, and positive values for `y` push the shape down from the origin point. Cuando colocas una forma en el área del `svg`, puedes especificar a donde va a ir con las coordenadas `x` asimismo `y`. El punto de origen (0, 0) está en la esquina superior izquierda. Los valores positivos de `x` empujan la forma a la derecha y los valores positivos para `y` empujan la forma hacia abajo desde el punto de origen.
To place a shape in the middle of the 500 (width) x 100 (height) `svg` from last challenge, the `x` coordinate would be 250 and the `y` coordinate would be 50. Para colocar una forma en medio del `svg` de 500 (ancho) x 100 (altura) del último reto, la coordenada `x` sería 250 y la coordenada `y` sería 50.
An SVG `rect` has four attributes. There are the `x` and `y` coordinates for where it is placed in the `svg` area. It also has a `height` and `width` to specify the size. Un rectángulo(`rect`) de SVG tiene cuatro atributos. Hay coordenadas `x` asimismo `y` para posicionarlo en el área del `svg`. También tiene un `height` (altura) y `width` (ancho) para especificar el tamaño.
# --instructions-- # --instructions--
Add a `rect` shape to the `svg` using `append()`, and give it a `width` attribute of `25` and `height` attribute of `100`. Also, give the `rect` `x` and `y` attributes each set to `0`. Añade una forma `rect` al `svg` usando `append()`, y dale un atributo `width` de `25` y un atributo `height` de `100`. Además, dale a `rect`, atributos `x` asimismo `y`, establece ambos valores en `0`.
# --hints-- # --hints--
Your document should have 1 `rect` element. Tu documento debe tener un elemento `rect`.
```js ```js
assert($('rect').length == 1); assert($('rect').length == 1);
``` ```
The `rect` element should have a `width` attribute set to `25`. El elemento `rect` debe tener un atributo `width` de `25`.
```js ```js
assert($('rect').attr('width') == '25'); assert($('rect').attr('width') == '25');
``` ```
The `rect` element should have a `height` attribute set to `100`. El elemento `rect` debe tener un atributo `height` de `100`.
```js ```js
assert($('rect').attr('height') == '100'); assert($('rect').attr('height') == '100');
``` ```
The `rect` element should have an `x` attribute set to `0`. El elemento `rect` debe tener un atributo `x` de `0`.
```js ```js
assert($('rect').attr('x') == '0'); assert($('rect').attr('x') == '0');
``` ```
The `rect` element should have a `y` attribute set to `0`. El elemento `rect` debe tener un atributo `y` de `0`.
```js ```js
assert($('rect').attr('y') == '0'); assert($('rect').attr('y') == '0');

View File

@ -69,12 +69,14 @@ assert(
La tua espressione regolare non dovrebbe riconoscere nessun criminale nella stringa vuota `""` La tua espressione regolare non dovrebbe riconoscere nessun criminale nella stringa vuota `""`
```js ```js
reCriminals.lastIndex = 0;
assert(!reCriminals.test('')); assert(!reCriminals.test(''));
``` ```
La tua espressione regolare non dovrebbe riconoscere nessun criminale nella stringa `P1P2P3` La tua espressione regolare non dovrebbe riconoscere nessun criminale nella stringa `P1P2P3`
```js ```js
reCriminals.lastIndex = 0;
assert(!reCriminals.test('P1P2P3')); assert(!reCriminals.test('P1P2P3'));
``` ```

View File

@ -23,60 +23,70 @@ Scrivi un'espressione regolare `fccRegex` per riconoscere `freeCodeCamp`, indipe
La tua espressione regolare dovrebbe riconoscere la stringa `freeCodeCamp` La tua espressione regolare dovrebbe riconoscere la stringa `freeCodeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('freeCodeCamp')); assert(fccRegex.test('freeCodeCamp'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `FreeCodeCamp` La tua espressione regolare dovrebbe riconoscere la stringa `FreeCodeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreeCodeCamp')); assert(fccRegex.test('FreeCodeCamp'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `FreecodeCamp` La tua espressione regolare dovrebbe riconoscere la stringa `FreecodeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreecodeCamp')); assert(fccRegex.test('FreecodeCamp'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `FreeCodecamp` La tua espressione regolare dovrebbe riconoscere la stringa `FreeCodecamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreeCodecamp')); assert(fccRegex.test('FreeCodecamp'));
``` ```
La tua espressione regolare non dovrebbe riconoscere la stringa `Free Code Camp` La tua espressione regolare non dovrebbe riconoscere la stringa `Free Code Camp`
```js ```js
fccRegex.lastIndex = 0;
assert(!fccRegex.test('Free Code Camp')); assert(!fccRegex.test('Free Code Camp'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `FreeCOdeCamp` La tua espressione regolare dovrebbe riconoscere la stringa `FreeCOdeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreeCOdeCamp')); assert(fccRegex.test('FreeCOdeCamp'));
``` ```
La tua espressione regolare non dovrebbe riconoscere la stringa `FCC` La tua espressione regolare non dovrebbe riconoscere la stringa `FCC`
```js ```js
fccRegex.lastIndex = 0;
assert(!fccRegex.test('FCC')); assert(!fccRegex.test('FCC'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `FrEeCoDeCamp` La tua espressione regolare dovrebbe riconoscere la stringa `FrEeCoDeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FrEeCoDeCamp')); assert(fccRegex.test('FrEeCoDeCamp'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `FrEeCodECamp` La tua espressione regolare dovrebbe riconoscere la stringa `FrEeCodECamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FrEeCodECamp')); assert(fccRegex.test('FrEeCodECamp'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `FReeCodeCAmp` La tua espressione regolare dovrebbe riconoscere la stringa `FReeCodeCAmp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FReeCodeCAmp')); assert(fccRegex.test('FReeCodeCAmp'));
``` ```

View File

@ -25,42 +25,49 @@ Completa l'espressione regolare `petRegex` per riconoscere gli animali domestici
La tua espressione regolare `petRegex` dovrebbe restituire `true` per la stringa `John has a pet dog.` La tua espressione regolare `petRegex` dovrebbe restituire `true` per la stringa `John has a pet dog.`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('John has a pet dog.')); assert(petRegex.test('John has a pet dog.'));
``` ```
La tua espressione regolare `petRegex` dovrebbe restituire `false` per la stringa `Emma has a pet rock.` La tua espressione regolare `petRegex` dovrebbe restituire `false` per la stringa `Emma has a pet rock.`
```js ```js
petRegex.lastIndex = 0;
assert(!petRegex.test('Emma has a pet rock.')); assert(!petRegex.test('Emma has a pet rock.'));
``` ```
La tua espressione regolare `petRegex` dovrebbe restituire `true` per la stringa `Emma has a pet bird.` La tua espressione regolare `petRegex` dovrebbe restituire `true` per la stringa `Emma has a pet bird.`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('Emma has a pet bird.')); assert(petRegex.test('Emma has a pet bird.'));
``` ```
La tua espressione regolare `petRegex` dovrebbe restituire `true` per la stringa `Liz has a pet cat.` La tua espressione regolare `petRegex` dovrebbe restituire `true` per la stringa `Liz has a pet cat.`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('Liz has a pet cat.')); assert(petRegex.test('Liz has a pet cat.'));
``` ```
La tua espressione regolare `petRegex` dovrebbe restituire `false` per la stringa `Kara has a pet dolphin.` La tua espressione regolare `petRegex` dovrebbe restituire `false` per la stringa `Kara has a pet dolphin.`
```js ```js
petRegex.lastIndex = 0;
assert(!petRegex.test('Kara has a pet dolphin.')); assert(!petRegex.test('Kara has a pet dolphin.'));
``` ```
La tua espressione regolare `petRegex` dovrebbe restituire `true` per la stringa `Alice has a pet fish.` La tua espressione regolare `petRegex` dovrebbe restituire `true` per la stringa `Alice has a pet fish.`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('Alice has a pet fish.')); assert(petRegex.test('Alice has a pet fish.'));
``` ```
La tua espressione regolare `petRegex` dovrebbe restituire `false` per la stringa `Jimmy has a pet computer.` La tua espressione regolare `petRegex` dovrebbe restituire `false` per la stringa `Jimmy has a pet computer.`
```js ```js
petRegex.lastIndex = 0;
assert(!petRegex.test('Jimmy has a pet computer.')); assert(!petRegex.test('Jimmy has a pet computer.'));
``` ```

View File

@ -43,12 +43,14 @@ assert(calRegex.flags == '');
La tua espressione regolare dovrebbe riconoscere `Cal` all'inizio della stringa. La tua espressione regolare dovrebbe riconoscere `Cal` all'inizio della stringa.
```js ```js
calRegex.lastIndex = 0;
assert(calRegex.test('Cal and Ricky both like racing.')); assert(calRegex.test('Cal and Ricky both like racing.'));
``` ```
La tua espressione regolare non dovrebbe riconoscere `Cal` nel mezzo di una stringa. La tua espressione regolare non dovrebbe riconoscere `Cal` nel mezzo di una stringa.
```js ```js
calRegex.lastIndex = 0;
assert(!calRegex.test('Ricky and Cal both like racing.')); assert(!calRegex.test('Ricky and Cal both like racing.'));
``` ```

View File

@ -43,6 +43,7 @@ assert(lastRegex.flags == '');
Dovresti riconoscere `caboose` alla fine della stringa `The last car on a train is the caboose` Dovresti riconoscere `caboose` alla fine della stringa `The last car on a train is the caboose`
```js ```js
lastRegex.lastIndex = 0;
assert(lastRegex.test('The last car on a train is the caboose')); assert(lastRegex.test('The last car on a train is the caboose'));
``` ```

View File

@ -38,12 +38,14 @@ Completa l'espressione regolare `waldoRegex` per trovare `"Waldo"` nella stringa
La tua espressione regolare `waldoRegex` dovrebbe trovare la stringa `Waldo` La tua espressione regolare `waldoRegex` dovrebbe trovare la stringa `Waldo`
```js ```js
waldoRegex.lastIndex = 0;
assert(waldoRegex.test(waldoIsHiding)); assert(waldoRegex.test(waldoIsHiding));
``` ```
La tua espressione regolare `waldoRegex` non dovrebbe cercare altro. La tua espressione regolare `waldoRegex` non dovrebbe cercare altro.
```js ```js
waldoRegex.lastIndex = 0;
assert(!waldoRegex.test('Somewhere is hiding in this text.')); assert(!waldoRegex.test('Somewhere is hiding in this text.'));
``` ```

View File

@ -52,48 +52,56 @@ assert(pwRegex.source.match(/\(\?=.*?\)\(\?=.*?\)/) !== null);
La tua espressione regolare non dovrebbe corrispondere alla stringa `astronaut` La tua espressione regolare non dovrebbe corrispondere alla stringa `astronaut`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('astronaut')); assert(!pwRegex.test('astronaut'));
``` ```
La tua espressione regolare non dovrebbe riconoscere la stringa `banan1` La tua espressione regolare non dovrebbe riconoscere la stringa `banan1`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('banan1')); assert(!pwRegex.test('banan1'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `bana12` La tua espressione regolare dovrebbe riconoscere la stringa `bana12`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('bana12')); assert(pwRegex.test('bana12'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `abc123` La tua espressione regolare dovrebbe riconoscere la stringa `abc123`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('abc123')); assert(pwRegex.test('abc123'));
``` ```
La tua espressione regolare non dovrebbe riconoscere la stringa `12345` La tua espressione regolare non dovrebbe riconoscere la stringa `12345`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('12345')); assert(!pwRegex.test('12345'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `8pass99` La tua espressione regolare dovrebbe riconoscere la stringa `8pass99`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('8pass99')); assert(pwRegex.test('8pass99'));
``` ```
La tua espressione regolare non dovrebbe riconoscere la stringa `1a2bcde` La tua espressione regolare non dovrebbe riconoscere la stringa `1a2bcde`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('1a2bcde')); assert(!pwRegex.test('1a2bcde'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `astr1on11aut` La tua espressione regolare dovrebbe riconoscere la stringa `astr1on11aut`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('astr1on11aut')); assert(pwRegex.test('astr1on11aut'));
``` ```

View File

@ -29,78 +29,91 @@ Cambia l'espressione regolare `userCheck` in modo che corrisponda ai vincoli ele
La tua espressione regolare dovrebbe riconoscere la stringa `JACK` La tua espressione regolare dovrebbe riconoscere la stringa `JACK`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('JACK')); assert(userCheck.test('JACK'));
``` ```
La tua espressione regolare non dovrebbe riconoscere la stringa `J` La tua espressione regolare non dovrebbe riconoscere la stringa `J`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('J')); assert(!userCheck.test('J'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `Jo` La tua espressione regolare dovrebbe riconoscere la stringa `Jo`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('Jo')); assert(userCheck.test('Jo'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `Oceans11` La tua espressione regolare dovrebbe riconoscere la stringa `Oceans11`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('Oceans11')); assert(userCheck.test('Oceans11'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `RegexGuru` La tua espressione regolare dovrebbe riconoscere la stringa `RegexGuru`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('RegexGuru')); assert(userCheck.test('RegexGuru'));
``` ```
La tua espressione regolare non dovrebbe riconoscere la stringa `007` La tua espressione regolare non dovrebbe riconoscere la stringa `007`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('007')); assert(!userCheck.test('007'));
``` ```
La tua espressione regolare non dovrebbe riconoscere la stringa `9` La tua espressione regolare non dovrebbe riconoscere la stringa `9`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('9')); assert(!userCheck.test('9'));
``` ```
La tua espressione regolare non dovrebbe riconoscere la stringa `A1` La tua espressione regolare non dovrebbe riconoscere la stringa `A1`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('A1')); assert(!userCheck.test('A1'));
``` ```
La tua espressione regolare non dovrebbe riconoscere la stringa `BadUs3rnam3` La tua espressione regolare non dovrebbe riconoscere la stringa `BadUs3rnam3`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('BadUs3rnam3')); assert(!userCheck.test('BadUs3rnam3'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `Z97` La tua espressione regolare dovrebbe riconoscere la stringa `Z97`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('Z97')); assert(userCheck.test('Z97'));
``` ```
La tua espressione regolare non dovrebbe riconoscere la stringa `c57bT3` La tua espressione regolare non dovrebbe riconoscere la stringa `c57bT3`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('c57bT3')); assert(!userCheck.test('c57bT3'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `AB1` La tua espressione regolare dovrebbe riconoscere la stringa `AB1`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('AB1')); assert(userCheck.test('AB1'));
``` ```
La tua espressione regolare non dovrebbe riconoscere la stringa `J%4` La tua espressione regolare non dovrebbe riconoscere la stringa `J%4`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('J%4')) assert(!userCheck.test('J%4'))
``` ```

View File

@ -52,12 +52,14 @@ assert(reRegex.source.match(/\\1|\\2/g).length >= 2);
La tua espressione regolare dovrebbe riconoscere la stringa `42 42 42`. La tua espressione regolare dovrebbe riconoscere la stringa `42 42 42`.
```js ```js
reRegex.lastIndex = 0;
assert(reRegex.test('42 42 42')); assert(reRegex.test('42 42 42'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `100 100 100`. La tua espressione regolare dovrebbe riconoscere la stringa `100 100 100`.
```js ```js
reRegex.lastIndex = 0;
assert(reRegex.test('100 100 100')); assert(reRegex.test('100 100 100'));
``` ```
@ -76,18 +78,21 @@ assert.equal('42 42'.match(reRegex.source), null);
La tua espressione regolare non dovrebbe riconoscere la stringa `101 102 103`. La tua espressione regolare non dovrebbe riconoscere la stringa `101 102 103`.
```js ```js
reRegex.lastIndex = 0;
assert(!reRegex.test('101 102 103')); assert(!reRegex.test('101 102 103'));
``` ```
La tua espressione regolare non dovrebbe riconoscere la stringa `1 2 3`. La tua espressione regolare non dovrebbe riconoscere la stringa `1 2 3`.
```js ```js
reRegex.lastIndex = 0;
assert(!reRegex.test('1 2 3')); assert(!reRegex.test('1 2 3'));
``` ```
La tua espressione regolare dovrebbe riconoscere la stringa `10 10 10`. La tua espressione regolare dovrebbe riconoscere la stringa `10 10 10`.
```js ```js
reRegex.lastIndex = 0;
assert(reRegex.test('10 10 10')); assert(reRegex.test('10 10 10'));
``` ```

View File

@ -41,12 +41,14 @@ assert(haRegex.source.match(/{.*?}/).length > 0);
La tua espressione regolare non dovrebbe riconoscere la stringa `Hazzah` La tua espressione regolare non dovrebbe riconoscere la stringa `Hazzah`
```js ```js
haRegex.lastIndex = 0;
assert(!haRegex.test('Hazzah')); assert(!haRegex.test('Hazzah'));
``` ```
La tua espressione regolare non dovrebbe riconoscere la stringa `Hazzzah` La tua espressione regolare non dovrebbe riconoscere la stringa `Hazzzah`
```js ```js
haRegex.lastIndex = 0;
assert(!haRegex.test('Hazzzah')); assert(!haRegex.test('Hazzzah'));
``` ```

View File

@ -39,6 +39,7 @@ assert(ohRegex.source.match(/{.*?}/).length > 0);
La tua espressione regolare non dovrebbe riconoscere la stringa `Ohh no` La tua espressione regolare non dovrebbe riconoscere la stringa `Ohh no`
```js ```js
ohRegex.lastIndex = 0;
assert(!ohRegex.test('Ohh no')); assert(!ohRegex.test('Ohh no'));
``` ```
@ -69,6 +70,7 @@ assert('Ohhhhhh no'.match(ohRegex)[0].length === 10);
La tua espressione regolare non dovrebbe riconoscere la stringa `Ohhhhhhh no` La tua espressione regolare non dovrebbe riconoscere la stringa `Ohhhhhhh no`
```js ```js
ohRegex.lastIndex = 0;
assert(!ohRegex.test('Ohhhhhhh no')); assert(!ohRegex.test('Ohhhhhhh no'));
``` ```

View File

@ -69,12 +69,14 @@ assert(
A regex não deve encontrar nenhum criminoso na string vazia `""` A regex não deve encontrar nenhum criminoso na string vazia `""`
```js ```js
reCriminals.lastIndex = 0;
assert(!reCriminals.test('')); assert(!reCriminals.test(''));
``` ```
A regex não deve encontrar nenhum criminoso na string `P1P2P3` A regex não deve encontrar nenhum criminoso na string `P1P2P3`
```js ```js
reCriminals.lastIndex = 0;
assert(!reCriminals.test('P1P2P3')); assert(!reCriminals.test('P1P2P3'));
``` ```

View File

@ -23,60 +23,70 @@ Escreva uma regex `fccRegex` que encontre `freeCodeCamp`, não importa em que ca
A regex deve encontrar a string `freeCodeCamp` A regex deve encontrar a string `freeCodeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('freeCodeCamp')); assert(fccRegex.test('freeCodeCamp'));
``` ```
A regex deve encontrar a string `FreeCodeCamp` A regex deve encontrar a string `FreeCodeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreeCodeCamp')); assert(fccRegex.test('FreeCodeCamp'));
``` ```
A regex deve encontrar a string `FreecodeCamp` A regex deve encontrar a string `FreecodeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreecodeCamp')); assert(fccRegex.test('FreecodeCamp'));
``` ```
A regex deve encontrar a string `FreeCodecamp` A regex deve encontrar a string `FreeCodecamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreeCodecamp')); assert(fccRegex.test('FreeCodecamp'));
``` ```
A regex não deve encontrar a string `Free Code Camp` A regex não deve encontrar a string `Free Code Camp`
```js ```js
fccRegex.lastIndex = 0;
assert(!fccRegex.test('Free Code Camp')); assert(!fccRegex.test('Free Code Camp'));
``` ```
A regex deve encontrar a string `FreeCOdeCamp` A regex deve encontrar a string `FreeCOdeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FreeCOdeCamp')); assert(fccRegex.test('FreeCOdeCamp'));
``` ```
A regex não deve encontrar a string `FCC` A regex não deve encontrar a string `FCC`
```js ```js
fccRegex.lastIndex = 0;
assert(!fccRegex.test('FCC')); assert(!fccRegex.test('FCC'));
``` ```
A regex deve encontrar a string `FrEeCoDeCamp` A regex deve encontrar a string `FrEeCoDeCamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FrEeCoDeCamp')); assert(fccRegex.test('FrEeCoDeCamp'));
``` ```
A regex deve encontrar a string `FrEeCodECamp` A regex deve encontrar a string `FrEeCodECamp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FrEeCodECamp')); assert(fccRegex.test('FrEeCodECamp'));
``` ```
A regex deve encontrar a string `FReeCodeCAmp` A regex deve encontrar a string `FReeCodeCAmp`
```js ```js
fccRegex.lastIndex = 0;
assert(fccRegex.test('FReeCodeCAmp')); assert(fccRegex.test('FReeCodeCAmp'));
``` ```

View File

@ -25,42 +25,49 @@ Complete a regex `petRegex` para encontrar os pets `dog`, `cat`, `bird`, ou `fis
A regex `petRegex` deve retornar `true` para a string `John has a pet dog.` A regex `petRegex` deve retornar `true` para a string `John has a pet dog.`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('John has a pet dog.')); assert(petRegex.test('John has a pet dog.'));
``` ```
A regex `petRegex` deve retornar `false` para a string `Emma has a pet rock.` A regex `petRegex` deve retornar `false` para a string `Emma has a pet rock.`
```js ```js
petRegex.lastIndex = 0;
assert(!petRegex.test('Emma has a pet rock.')); assert(!petRegex.test('Emma has a pet rock.'));
``` ```
A regex `petRegex` deve retornar `true` para a string `Emma has a pet bird.` A regex `petRegex` deve retornar `true` para a string `Emma has a pet bird.`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('Emma has a pet bird.')); assert(petRegex.test('Emma has a pet bird.'));
``` ```
A regex `petRegex` deve retornar `true` para a string `Liz has a pet cat.` A regex `petRegex` deve retornar `true` para a string `Liz has a pet cat.`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('Liz has a pet cat.')); assert(petRegex.test('Liz has a pet cat.'));
``` ```
A regex `petRegex` deve retornar `false` para a string `Kara has a pet dolphin.` A regex `petRegex` deve retornar `false` para a string `Kara has a pet dolphin.`
```js ```js
petRegex.lastIndex = 0;
assert(!petRegex.test('Kara has a pet dolphin.')); assert(!petRegex.test('Kara has a pet dolphin.'));
``` ```
A regex `petRegex` deve retornar `true` para a string `Alice has a pet fish.` A regex `petRegex` deve retornar `true` para a string `Alice has a pet fish.`
```js ```js
petRegex.lastIndex = 0;
assert(petRegex.test('Alice has a pet fish.')); assert(petRegex.test('Alice has a pet fish.'));
``` ```
A regex `petRegex` deve retornar `false` para a string `Jimmy has a pet computer.` A regex `petRegex` deve retornar `false` para a string `Jimmy has a pet computer.`
```js ```js
petRegex.lastIndex = 0;
assert(!petRegex.test('Jimmy has a pet computer.')); assert(!petRegex.test('Jimmy has a pet computer.'));
``` ```

View File

@ -43,12 +43,14 @@ assert(calRegex.flags == '');
A regex deve capturar a string `Cal` no começo de uma string. A regex deve capturar a string `Cal` no começo de uma string.
```js ```js
calRegex.lastIndex = 0;
assert(calRegex.test('Cal and Ricky both like racing.')); assert(calRegex.test('Cal and Ricky both like racing.'));
``` ```
A regex não deve capturar a string `Cal` no meio de uma string. A regex não deve capturar a string `Cal` no meio de uma string.
```js ```js
calRegex.lastIndex = 0;
assert(!calRegex.test('Ricky and Cal both like racing.')); assert(!calRegex.test('Ricky and Cal both like racing.'));
``` ```

View File

@ -43,6 +43,7 @@ assert(lastRegex.flags == '');
Você deve capturar `caboose` no fim da string `The last car on a train is the caboose` Você deve capturar `caboose` no fim da string `The last car on a train is the caboose`
```js ```js
lastRegex.lastIndex = 0;
assert(lastRegex.test('The last car on a train is the caboose')); assert(lastRegex.test('The last car on a train is the caboose'));
``` ```

View File

@ -38,12 +38,14 @@ Complete a regex `waldoRegex` para encontrar `"Waldo"` na string `waldoIsHiding`
A regex `waldoRegex` deve encontrar a string `Waldo` A regex `waldoRegex` deve encontrar a string `Waldo`
```js ```js
waldoRegex.lastIndex = 0;
assert(waldoRegex.test(waldoIsHiding)); assert(waldoRegex.test(waldoIsHiding));
``` ```
A regex `waldoRegex` não deve buscar nada além disso. A regex `waldoRegex` não deve buscar nada além disso.
```js ```js
waldoRegex.lastIndex = 0;
assert(!waldoRegex.test('Somewhere is hiding in this text.')); assert(!waldoRegex.test('Somewhere is hiding in this text.'));
``` ```

View File

@ -52,48 +52,56 @@ assert(pwRegex.source.match(/\(\?=.*?\)\(\?=.*?\)/) !== null);
A regex não deve encontrar a string `astronaut` A regex não deve encontrar a string `astronaut`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('astronaut')); assert(!pwRegex.test('astronaut'));
``` ```
A regex não deve encontrar a string `banan1` A regex não deve encontrar a string `banan1`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('banan1')); assert(!pwRegex.test('banan1'));
``` ```
A regex deve encontrar a string `bana12` A regex deve encontrar a string `bana12`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('bana12')); assert(pwRegex.test('bana12'));
``` ```
A regex deve encontrar a string `abc123` A regex deve encontrar a string `abc123`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('abc123')); assert(pwRegex.test('abc123'));
``` ```
A regex não deve encontrar a string `12345` A regex não deve encontrar a string `12345`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('12345')); assert(!pwRegex.test('12345'));
``` ```
A regex deve encontrar a string `8pass99` A regex deve encontrar a string `8pass99`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('8pass99')); assert(pwRegex.test('8pass99'));
``` ```
A regex não deve encontrar a string `1a2bcde` A regex não deve encontrar a string `1a2bcde`
```js ```js
pwRegex.lastIndex = 0;
assert(!pwRegex.test('1a2bcde')); assert(!pwRegex.test('1a2bcde'));
``` ```
A regex deve encontrar a string `astr1on11aut` A regex deve encontrar a string `astr1on11aut`
```js ```js
pwRegex.lastIndex = 0;
assert(pwRegex.test('astr1on11aut')); assert(pwRegex.test('astr1on11aut'));
``` ```

View File

@ -29,78 +29,91 @@ Modifique a regex `userCheck` para que inclua as regras listadas.
A regex deve encontrar a string `JACK` A regex deve encontrar a string `JACK`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('JACK')); assert(userCheck.test('JACK'));
``` ```
A regex não deve encontrar a string `J` A regex não deve encontrar a string `J`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('J')); assert(!userCheck.test('J'));
``` ```
A regex deve encontrar a string `Jo` A regex deve encontrar a string `Jo`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('Jo')); assert(userCheck.test('Jo'));
``` ```
A regex deve encontrar a string `Oceans11` A regex deve encontrar a string `Oceans11`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('Oceans11')); assert(userCheck.test('Oceans11'));
``` ```
A regex deve encontrar a string `RegexGuru` A regex deve encontrar a string `RegexGuru`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('RegexGuru')); assert(userCheck.test('RegexGuru'));
``` ```
A regex não deve encontrar a string `007` A regex não deve encontrar a string `007`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('007')); assert(!userCheck.test('007'));
``` ```
A regex não deve encontrar a string `9` A regex não deve encontrar a string `9`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('9')); assert(!userCheck.test('9'));
``` ```
A regex não deve encontrar a string `A1` A regex não deve encontrar a string `A1`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('A1')); assert(!userCheck.test('A1'));
``` ```
A regex não deve encontrar a string `BadUs3rnam3` A regex não deve encontrar a string `BadUs3rnam3`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('BadUs3rnam3')); assert(!userCheck.test('BadUs3rnam3'));
``` ```
A regex deve encontrar a string `Z97` A regex deve encontrar a string `Z97`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('Z97')); assert(userCheck.test('Z97'));
``` ```
A regex não deve encontrar a string `c57bT3` A regex não deve encontrar a string `c57bT3`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('c57bT3')); assert(!userCheck.test('c57bT3'));
``` ```
A regex deve encontrar a string `AB1` A regex deve encontrar a string `AB1`
```js ```js
userCheck.lastIndex = 0;
assert(userCheck.test('AB1')); assert(userCheck.test('AB1'));
``` ```
A regex não deve encontrar a string `J%4` A regex não deve encontrar a string `J%4`
```js ```js
userCheck.lastIndex = 0;
assert(!userCheck.test('J%4')) assert(!userCheck.test('J%4'))
``` ```

View File

@ -52,12 +52,14 @@ assert(reRegex.source.match(/\\1|\\2/g).length >= 2);
A regex deve encontrar a string `42 42 42`. A regex deve encontrar a string `42 42 42`.
```js ```js
reRegex.lastIndex = 0;
assert(reRegex.test('42 42 42')); assert(reRegex.test('42 42 42'));
``` ```
A regex deve encontrar a string `100 100 100`. A regex deve encontrar a string `100 100 100`.
```js ```js
reRegex.lastIndex = 0;
assert(reRegex.test('100 100 100')); assert(reRegex.test('100 100 100'));
``` ```
@ -76,18 +78,21 @@ assert.equal('42 42'.match(reRegex.source), null);
A regex não deve encontrar a string `101 102 103`. A regex não deve encontrar a string `101 102 103`.
```js ```js
reRegex.lastIndex = 0;
assert(!reRegex.test('101 102 103')); assert(!reRegex.test('101 102 103'));
``` ```
A regex não deve encontrar a string `1 2 3`. A regex não deve encontrar a string `1 2 3`.
```js ```js
reRegex.lastIndex = 0;
assert(!reRegex.test('1 2 3')); assert(!reRegex.test('1 2 3'));
``` ```
A regex deve encontrar a string `10 10 10`. A regex deve encontrar a string `10 10 10`.
```js ```js
reRegex.lastIndex = 0;
assert(reRegex.test('10 10 10')); assert(reRegex.test('10 10 10'));
``` ```

View File

@ -41,12 +41,14 @@ assert(haRegex.source.match(/{.*?}/).length > 0);
A regex não deve encontrar a string `Hazzah` A regex não deve encontrar a string `Hazzah`
```js ```js
haRegex.lastIndex = 0;
assert(!haRegex.test('Hazzah')); assert(!haRegex.test('Hazzah'));
``` ```
A regex não deve encontrar a string `Hazzzah` A regex não deve encontrar a string `Hazzzah`
```js ```js
haRegex.lastIndex = 0;
assert(!haRegex.test('Hazzzah')); assert(!haRegex.test('Hazzzah'));
``` ```

View File

@ -39,6 +39,7 @@ assert(ohRegex.source.match(/{.*?}/).length > 0);
A regex não deve encontrar a string `Ohh no` A regex não deve encontrar a string `Ohh no`
```js ```js
ohRegex.lastIndex = 0;
assert(!ohRegex.test('Ohh no')); assert(!ohRegex.test('Ohh no'));
``` ```
@ -69,6 +70,7 @@ assert('Ohhhhhh no'.match(ohRegex)[0].length === 10);
A regex não deve encontrar a string `Ohhhhhhh no` A regex não deve encontrar a string `Ohhhhhhh no`
```js ```js
ohRegex.lastIndex = 0;
assert(!ohRegex.test('Ohhhhhhh no')); assert(!ohRegex.test('Ohhhhhhh no'));
``` ```