fix: add additional tests for Regular Expression challenge (#18696)
fix(curriculum): add additional tests and solution for Restrict Possible Usernames challenge
This commit is contained in:
@ -35,6 +35,10 @@ tests:
|
|||||||
testString: assert(!userCheck.test("007"), 'Your regex should not match <code>007</code>');
|
testString: assert(!userCheck.test("007"), 'Your regex should not match <code>007</code>');
|
||||||
- text: Your regex should not match <code>9</code>
|
- text: Your regex should not match <code>9</code>
|
||||||
testString: assert(!userCheck.test("9"), 'Your regex should not match <code>9</code>');
|
testString: assert(!userCheck.test("9"), 'Your regex should not match <code>9</code>');
|
||||||
|
- text: Your regex should not match <code>A1</code>
|
||||||
|
testString: assert(!userCheck.test("A1"), 'Your regex should not match <code>A1</code>');
|
||||||
|
- text: Your regex should not match <code>BadUs3rnam3</code>
|
||||||
|
testString: assert(!userCheck.test("BadUs3rnam3"), 'Your regex should not match <code>BadUs3rnam3</code>');
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -61,6 +65,7 @@ let result = userCheck.test(username);
|
|||||||
<section id='solution'>
|
<section id='solution'>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// solution required
|
const userCheck = /^[A-Za-z]{2,}\d*$/;
|
||||||
```
|
```
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
Reference in New Issue
Block a user