From 54074a790c37d90afe9396131ded79b0c4919830 Mon Sep 17 00:00:00 2001 From: Carol W <8996597+cazyw@users.noreply.github.com> Date: Wed, 7 Nov 2018 00:21:26 +1100 Subject: [PATCH] fix: add additional tests for Regular Expression challenge (#18696) fix(curriculum): add additional tests and solution for Restrict Possible Usernames challenge --- .../restrict-possible-usernames.english.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/restrict-possible-usernames.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/restrict-possible-usernames.english.md index 58becfb24e..29082b246b 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/restrict-possible-usernames.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/restrict-possible-usernames.english.md @@ -35,6 +35,10 @@ tests: testString: assert(!userCheck.test("007"), 'Your regex should not match 007'); - text: Your regex should not match 9 testString: assert(!userCheck.test("9"), 'Your regex should not match 9'); + - text: Your regex should not match A1 + testString: assert(!userCheck.test("A1"), 'Your regex should not match A1'); + - text: Your regex should not match BadUs3rnam3 + testString: assert(!userCheck.test("BadUs3rnam3"), 'Your regex should not match BadUs3rnam3'); ``` @@ -61,6 +65,7 @@ let result = userCheck.test(username);
```js -// solution required +const userCheck = /^[A-Za-z]{2,}\d*$/; ``` +