From be69f349d0abf1d3971a4330a66e72565cb3a1d1 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Mon, 1 Nov 2021 21:18:23 +0300 Subject: [PATCH] minor fixes --- 9-regular-expressions/05-regexp-multiline-mode/article.md | 8 ++++---- .../11-regexp-groups/01-test-mac/solution.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/9-regular-expressions/05-regexp-multiline-mode/article.md b/9-regular-expressions/05-regexp-multiline-mode/article.md index 1c8b36d0..5d4c48bf 100644 --- a/9-regular-expressions/05-regexp-multiline-mode/article.md +++ b/9-regular-expressions/05-regexp-multiline-mode/article.md @@ -16,7 +16,7 @@ let str = `1st place: Winnie 3rd place: Eeyore`; *!* -alert( str.match(/^\d/gm) ); // 1, 2, 3 +console.log( str.match(/^\d/gm) ); // 1, 2, 3 */!* ``` @@ -28,7 +28,7 @@ let str = `1st place: Winnie 3rd place: Eeyore`; *!* -alert( str.match(/^\d/g) ); // 1 +console.log( str.match(/^\d/g) ); // 1 */!* ``` @@ -51,7 +51,7 @@ let str = `Winnie: 1 Piglet: 2 Eeyore: 3`; -alert( str.match(/\d$/gm) ); // 1,2,3 +console.log( str.match(/\d$/gm) ); // 1,2,3 ``` Without the flag `pattern:m`, the dollar `pattern:$` would only match the end of the whole text, so only the very last digit would be found. @@ -75,7 +75,7 @@ let str = `Winnie: 1 Piglet: 2 Eeyore: 3`; -alert( str.match(/\d\n/gm) ); // 1\n,2\n +console.log( str.match(/\d\n/gm) ); // 1\n,2\n ``` As we can see, there are 2 matches instead of 3. diff --git a/9-regular-expressions/11-regexp-groups/01-test-mac/solution.md b/9-regular-expressions/11-regexp-groups/01-test-mac/solution.md index 26f7888f..f7a5f1e3 100644 --- a/9-regular-expressions/11-regexp-groups/01-test-mac/solution.md +++ b/9-regular-expressions/11-regexp-groups/01-test-mac/solution.md @@ -9,7 +9,7 @@ Now let's show that the match should capture all the text: start at the beginnin Finally: ```js run -let regexp = /^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$/i; +let regexp = /^[0-9a-f]{2}(:[0-9a-f]{2}){5}$/i; alert( regexp.test('01:32:54:67:89:AB') ); // true