diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/reuse-patterns-using-capture-groups.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/reuse-patterns-using-capture-groups.english.md index ea164fec30..d7ba061ca9 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/reuse-patterns-using-capture-groups.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/reuse-patterns-using-capture-groups.english.md @@ -32,25 +32,25 @@ Use capture groups in reRegex to match numbers that ar ```yml tests: - text: Your regex should use the shorthand character class for digits. - testString: assert(reRegex.source.match(/\\d/), 'Your regex should use the shorthand character class for digits.'); - - text: Your regex should reuse the capture group twice. - testString: assert(reRegex.source.match(/\\\d/g).length === 2, 'Your regex should reuse the capture group twice.'); + testString: assert(reRegex.source.match(/\\d/)); + - text: Your regex should reuse a capture group twice. + testString: assert(reRegex.source.match(/\\1|\\2/g).length >= 2); - text: Your regex should have two spaces separating the three numbers. - testString: assert(reRegex.source.match(/ |\\s/g).length === 2, 'Your regex should have two spaces separating the three numbers.'); + testString: assert(reRegex.source.match(/ |\\s/g).length === 2 || reRegex.source.match(/\(\\s\)(?=.*\\(1|2))/g)); - text: Your regex should match "42 42 42". - testString: assert(reRegex.test("42 42 42"), 'Your regex should match "42 42 42".'); + testString: assert(reRegex.test("42 42 42")); - text: Your regex should match "100 100 100". - testString: assert(reRegex.test("100 100 100"), 'Your regex should match "100 100 100".'); + testString: assert(reRegex.test("100 100 100")); - text: Your regex should not match "42 42 42 42". - testString: assert.equal(("42 42 42 42").match(reRegex.source), null, 'Your regex should not match "42 42 42 42".'); + testString: assert.equal(("42 42 42 42").match(reRegex.source), null); - text: Your regex should not match "42 42". - testString: assert.equal(("42 42").match(reRegex.source), null, 'Your regex should not match "42 42".'); + testString: assert.equal(("42 42").match(reRegex.source), null); - text: Your regex should not match "101 102 103". - testString: assert(!reRegex.test("101 102 103"), 'Your regex should not match "101 102 103".'); + testString: assert(!reRegex.test("101 102 103")); - text: Your regex should not match "1 2 3". - testString: assert(!reRegex.test("1 2 3"), 'Your regex should not match "1 2 3".'); + testString: assert(!reRegex.test("1 2 3")); - text: Your regex should match "10 10 10". - testString: assert(reRegex.test("10 10 10"), 'Your regex should match "10 10 10".'); + testString: assert(reRegex.test("10 10 10")); ```