From 61888a265d2dfc5c34e52f00074c22f88dee73c1 Mon Sep 17 00:00:00 2001 From: Lavrentiy Rubtsov Date: Tue, 7 Jun 2022 17:29:50 +0600 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=91=BE=20fix=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2-insert-after-head/solution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/9-regular-expressions/14-regexp-lookahead-lookbehind/2-insert-after-head/solution.md b/9-regular-expressions/14-regexp-lookahead-lookbehind/2-insert-after-head/solution.md index b1d377d3..34f65fe5 100644 --- a/9-regular-expressions/14-regexp-lookahead-lookbehind/2-insert-after-head/solution.md +++ b/9-regular-expressions/14-regexp-lookahead-lookbehind/2-insert-after-head/solution.md @@ -26,7 +26,7 @@ As you can see, there's only lookbehind part in this regexp. It works like this: - At every position in the text. -- Check if it's preceeded by `pattern:`. +- Check if it's preceded by `pattern:`. - If it's so then we have the match. The tag `pattern:` won't be returned. The result of this regexp is literally an empty string, but it matches only at positions preceeded by `pattern:`. From d9ab4cf2bc6717deb47ea3881d3a4f5f621867f7 Mon Sep 17 00:00:00 2001 From: Lavrentiy Rubtsov Date: Tue, 7 Jun 2022 17:33:09 +0600 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=91=BE=20smth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2-insert-after-head/solution.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/9-regular-expressions/14-regexp-lookahead-lookbehind/2-insert-after-head/solution.md b/9-regular-expressions/14-regexp-lookahead-lookbehind/2-insert-after-head/solution.md index 34f65fe5..68bca884 100644 --- a/9-regular-expressions/14-regexp-lookahead-lookbehind/2-insert-after-head/solution.md +++ b/9-regular-expressions/14-regexp-lookahead-lookbehind/2-insert-after-head/solution.md @@ -1,6 +1,6 @@ In order to insert after the `` tag, we must first find it. We can use the regular expression pattern `pattern:` for that. -In this task we don't need to modify the `` tag. We only need to add the text after it. +In this task, we don't need to modify the `` tag. We only need to add the text after it. Here's how we can do it: @@ -27,10 +27,10 @@ As you can see, there's only lookbehind part in this regexp. It works like this: - At every position in the text. - Check if it's preceded by `pattern:`. -- If it's so then we have the match. +- If it's so, then we have the match. -The tag `pattern:` won't be returned. The result of this regexp is literally an empty string, but it matches only at positions preceeded by `pattern:`. +The tag `pattern:` won't be returned. The result of this regexp is literally an empty string, but it matches only at positions preceded by `pattern:`. -So it replaces the "empty line", preceeded by `pattern:`, with `

Hello

`. That's the insertion after ``. +So it replaces the "empty line", preceded by `pattern:`, with `

Hello

`. That's the insertion after ``. P.S. Regexp flags, such as `pattern:s` and `pattern:i` can also be useful: `pattern://si`. The `pattern:s` flag makes the dot `pattern:.` match a newline character, and `pattern:i` flag makes `pattern:` also match `match:` case-insensitively. From fec6e3dae4d8433c665fcb2f272d343fa3092f74 Mon Sep 17 00:00:00 2001 From: Lavrentiy Rubtsov Date: Tue, 7 Jun 2022 17:53:53 +0600 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=91=BE=20smth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../14-regexp-lookahead-lookbehind/2-insert-after-head/task.md | 1 + 1 file changed, 1 insertion(+) diff --git a/9-regular-expressions/14-regexp-lookahead-lookbehind/2-insert-after-head/task.md b/9-regular-expressions/14-regexp-lookahead-lookbehind/2-insert-after-head/task.md index be1a259f..5ee42798 100644 --- a/9-regular-expressions/14-regexp-lookahead-lookbehind/2-insert-after-head/task.md +++ b/9-regular-expressions/14-regexp-lookahead-lookbehind/2-insert-after-head/task.md @@ -21,6 +21,7 @@ str = str.replace(regexp, `

Hello

`); ``` After that the value of `str` should be: + ```html

Hello