From 9c0337d0a686ca5e9615928befe3959f5c743778 Mon Sep 17 00:00:00 2001 From: LeviDing Date: Sun, 7 Aug 2022 17:58:31 +0800 Subject: [PATCH] fix: shash -> backslash --- .../13-regexp-alternation/03-match-quoted-string/task.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/9-regular-expressions/13-regexp-alternation/03-match-quoted-string/task.md b/9-regular-expressions/13-regexp-alternation/03-match-quoted-string/task.md index ad41d91b..27b6bc5c 100644 --- a/9-regular-expressions/13-regexp-alternation/03-match-quoted-string/task.md +++ b/9-regular-expressions/13-regexp-alternation/03-match-quoted-string/task.md @@ -2,7 +2,7 @@ Create a regexp to find strings in double quotes `subject:"..."`. -The strings should support escaping, the same way as JavaScript strings do. For instance, quotes can be inserted as `subject:\"` a newline as `subject:\n`, and the slash itself as `subject:\\`. +The strings should support escaping, the same way as JavaScript strings do. For instance, quotes can be inserted as `subject:\"` a newline as `subject:\n`, and the backslash itself as `subject:\\`. ```js let str = "Just like \"here\"."; @@ -18,11 +18,11 @@ Examples of strings to match: ```js .. *!*"test me"*/!* .. .. *!*"Say \"Hello\"!"*/!* ... (escaped quotes inside) -.. *!*"\\"*/!* .. (double slash inside) -.. *!*"\\ \""*/!* .. (double slash and an escaped quote inside) +.. *!*"\\"*/!* .. (double backslash inside) +.. *!*"\\ \""*/!* .. (double backslash and an escaped quote inside) ``` -In JavaScript we need to double the slashes to pass them right into the string, like this: +In JavaScript we need to double the backslashes to pass them right into the string, like this: ```js run let str = ' .. "test me" .. "Say \\"Hello\\"!" .. "\\\\ \\"" .. ';