From 35d7501162d10bd162595748898a94f0e85c9387 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Thu, 10 Oct 2019 11:12:23 +0300 Subject: [PATCH] fix --- .../02-regexp-character-classes/article.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/9-regular-expressions/02-regexp-character-classes/article.md b/9-regular-expressions/02-regexp-character-classes/article.md index 10ed1c3a..dff5ecaa 100644 --- a/9-regular-expressions/02-regexp-character-classes/article.md +++ b/9-regular-expressions/02-regexp-character-classes/article.md @@ -145,14 +145,17 @@ alert( "A\nB".match(/A.B/s) ); // A\nB (match!) ``` ````warn header="Not supported in Firefox, IE, Edge" -Check for the most recent state of support. +Check for the most recent state of support. At the time of writing it doesn't include Firefox, IE, Edge. -Luckily, there's an alternative. We can use a regexp like `pattern:[\s\S]` to match "any character". +Luckily, there's an alternative, that works everywhere. We can use a regexp like `pattern:[\s\S]` to match "any character". ```js run alert( "A\nB".match(/A[\s\S]B/) ); // A\nB (match!) ``` -This works everywhere. + +The pattern `regexp:[\s\S]` literally says: "a space character OR not a space character", that is "anything". + +This works everywhere. Also we can use it if we don't want to use `pattern:s` flag, in cases when we want a regular "no-newline" dot too in the pattern. ```` ````warn header="Pay attention to spaces"