diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.english.md index 955f2b772a..a21780d60e 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/check-for-mixed-grouping-of-characters.english.md @@ -13,7 +13,7 @@ Then check whether the desired string groups are in the test string by using the ```js let testStr = "Pumpkin"; -let testRegex = /P(engu|umpk)in/g; +let testRegex = /P(engu|umpk)in/; testRegex.test(testStr); // Returns true ``` @@ -32,11 +32,11 @@ Then fix the code so that the regex that you have created is checked against myRegex should return true for the string Franklin D. Roosevelt - testString: assert(myRegex.test('Franklin D. Roosevelt')); + testString: myRegex.lastIndex = 0; assert(myRegex.test('Franklin D. Roosevelt')); - text: Your regex myRegex should return true for the string Eleanor Roosevelt - testString: assert(myRegex.test('Eleanor Roosevelt')); + testString: myRegex.lastIndex = 0; assert(myRegex.test('Eleanor Roosevelt')); - text: Your regex myRegex should return false for the string Franklin Rosevelt - testString: assert(!myRegex.test('Franklin Rosevelt')); + testString: myRegex.lastIndex = 0; assert(!myRegex.test('Franklin Rosevelt')); - text: You should use .test() to test the regex. testString: assert(code.match(/myRegex.test\(\s*myString\s*\)/)); - text: Your result should return true.