diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none.english.md index 6b726bbaef..100473323e 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none.english.md @@ -32,13 +32,13 @@ Change the regex favRegex to match both the American English (favor ```yml tests: - text: Your regex should use the optional symbol, ?. - testString: assert(favRegex.source.match(/\?/).length > 0); + testString: favRegex.lastIndex = 0; assert(favRegex.source.match(/\?/).length > 0); - text: Your regex should match "favorite" - testString: assert(favRegex.test("favorite")); + testString: favRegex.lastIndex = 0; assert(favRegex.test("favorite")); - text: Your regex should match "favourite" - testString: assert(favRegex.test("favourite")); + testString: favRegex.lastIndex = 0; assert(favRegex.test("favourite")); - text: Your regex should not match "fav" - testString: assert(!favRegex.test("fav")); + testString: favRegex.lastIndex = 0; assert(!favRegex.test("fav")); ```