mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-30 03:03:06 -05:00
fix(curriculum): add test cases to ensure single whitespace (#49417)
* fix: update solutions regex to reflect test cases --------- Co-authored-by: javrrr <javrrr@gmail>
This commit is contained in:
@@ -96,6 +96,20 @@ reRegex.lastIndex = 0;
|
||||
assert(reRegex.test('10 10 10'));
|
||||
```
|
||||
|
||||
Your regex should not match the string `42\t42\t42`.
|
||||
|
||||
```js
|
||||
reRegex.lastIndex = 0;
|
||||
assert(!reRegex.test('42\t42\t42'));
|
||||
```
|
||||
|
||||
Your regex should not match the string `42 42 42`.
|
||||
|
||||
```js
|
||||
reRegex.lastIndex = 0;
|
||||
assert(!reRegex.test('42 42 42'));
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
@@ -110,6 +124,6 @@ let result = reRegex.test(repeatNum);
|
||||
|
||||
```js
|
||||
let repeatNum = "42 42 42";
|
||||
let reRegex = /^(\d+)\s\1\s\1$/;
|
||||
let reRegex = /^(\d+) \1 \1$/;
|
||||
let result = reRegex.test(repeatNum);
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user