diff --git a/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/reuse-patterns-using-capture-groups/index.md b/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/reuse-patterns-using-capture-groups/index.md index 2cad5c229f..7090dce096 100644 --- a/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/reuse-patterns-using-capture-groups/index.md +++ b/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/reuse-patterns-using-capture-groups/index.md @@ -6,7 +6,7 @@ title: Reuse Patterns Using Capture Groups ## Hint 1: Given code below: ```javascript -let testString = "test test test "; +let testString = "test test test"; let reRegex =/(test)\s\1/; let result = reRegex.test(testString); ``` @@ -18,16 +18,16 @@ If we were to literally translate the regex, it would look something like this: let re = /(test)\s\1/; let literalRe = /test\stest/; ``` -Both `rea` and `literalRe` would match the same thing. +Both `re` and `literalRe` would match the same thing. ## Hint 2: Given the code below: ```javascript -let testString = "test test test "; +let testString = "test test test"; let reRegex =/(test)(\s)\1\2\1/; let result = reRegex.test(testString); ``` -will match whole `test test test` because: +`result` will match whole `test test test` because: `\1` repeats (test) `\2` repeats (\s)