Fixed spelling errors, omissions, code typos (#34145)

Added missing regex tags at the end, fixed variable name, and erased an unnecessary space at the end of some of the test strings.
This commit is contained in:
Andrei Calinescu
2019-01-26 16:42:35 +09:00
committed by Randell Dawson
parent 1d524f9746
commit 6f04b00ea0

View File

@ -18,7 +18,7 @@ If we were to literally translate the regex, it would look something like this:
let re = /(test)\s\1/; let re = /(test)\s\1/;
let literalRe = /test\stest/; let literalRe = /test\stest/;
``` ```
Both `rea` and `literalRe` would match the same thing. Both `re` and `literalRe` would match the same thing.
## Hint 2: ## Hint 2:
Given the code below: Given the code below:
@ -27,7 +27,7 @@ let testString = "test test test ";
let reRegex =/(test)(\s)\1\2\1/; let reRegex =/(test)(\s)\1\2\1/;
let result = reRegex.test(testString); let result = reRegex.test(testString);
``` ```
will match whole `test test test` because: `result` will match whole `test test test` because:
`\1` repeats (test) `\1` repeats (test)
`\2` repeats (\s) `\2` repeats (\s)