This commit is contained in:
Ilya Kantor 2019-10-10 11:15:10 +03:00
parent 8c8dde6abb
commit 0e212f1165

View file

@ -153,7 +153,7 @@ Luckily, there's an alternative, that works everywhere. We can use a regexp like
alert( "A\nB".match(/A[\s\S]B/) ); // A\nB (match!) alert( "A\nB".match(/A[\s\S]B/) ); // A\nB (match!)
``` ```
The pattern `pattern:[\s\S]` literally says: "a space character OR not a space character", that is "anything". The pattern `pattern:[\s\S]` literally says: "a space character OR not a space character". In other words, "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. 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.
```` ````