diff --git a/challenges/02-javascript-algorithms-and-data-structures/regular-expressions.json b/challenges/02-javascript-algorithms-and-data-structures/regular-expressions.json index bb651561bd..893067c4ee 100644 --- a/challenges/02-javascript-algorithms-and-data-structures/regular-expressions.json +++ b/challenges/02-javascript-algorithms-and-data-structures/regular-expressions.json @@ -910,7 +910,7 @@ "
let repeatStr = \"regex regex\";", "Using the
let repeatRegex = /(\\w+)\\s\\1/;
repeatRegex.test(repeatStr); // Returns true
repeatStr.match(repeatRegex); // Returns [\"regex regex\", \"regex\"]
.match()
method on a string will return an array with the string it matches, along with its capture group.",
"capture groups
in reRegex
to match numbers that appear three times in a string each separated by a space."
+ "Use capture groups
in reRegex
to match numbers that are repeated only three times in a string, each separated by a space."
],
"challengeSeed": [
"let repeatNum = \"42 42 42\";",
@@ -923,7 +923,7 @@
"assert(reRegex.source.match(/\\\\s/g).length === 2, 'message: Your regex should have two spaces separating the three numbers.');",
"assert(reRegex.test(\"42 42 42\"), 'message: Your regex should match \"42 42 42\"
.');",
"assert(reRegex.test(\"100 100 100\"), 'message: Your regex should match \"100 100 100\"
.');",
- "assert.equal((\"42 42 42 42\").match(reRegex.source)[0], (\"42 42 42\"), 'message: Your regex should not match \"42 42 42 42\"
.');",
+ "assert.equal((\"42 42 42 42\").match(reRegex.source), null, 'message: Your regex should not match \"42 42 42 42\"
.');",
"assert.equal((\"42 42\").match(reRegex.source), null, 'message: Your regex should not match \"42 42\"
.');",
"assert(!reRegex.test(\"101 102 103\"), 'message: Your regex should not match \"101 102 103\"
.');",
"assert(!reRegex.test(\"1 2 3\"), 'message: Your regex should not match \"1 2 3\"
.');",