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:
Carol W
2018-11-07 00:21:26 +11:00
committed by Valeriy
parent 4cec01a21c
commit 54074a790c

View File

@ -35,6 +35,10 @@ tests:
testString: assert(!userCheck.test("007"), 'Your regex should not match <code>007</code>');
- text: 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'>
```js
// solution required
const userCheck = /^[A-Za-z]{2,}\d*$/;
```
</section>