Skip to content

Commit 81e9f17

Browse files
committed
minor fixes
1 parent 3899cc0 commit 81e9f17

File tree

1 file changed

+1
-1
lines changed
  • 9-regular-expressions/02-regexp-character-classes

1 file changed

+1
-1
lines changed

9-regular-expressions/02-regexp-character-classes/article.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ alert( "A\nB".match(/A[\s\S]B/) ); // A\nB (match!)
155155
156156
The pattern `pattern:[\s\S]` literally says: "a space character OR not a space character". In other words, "anything". We could use another pair of complementary classes, such as `pattern:[\d\D]`, that doesn't matter. Or even the `pattern:[^]` -- as it means match any character except nothing.
157157
158-
This trick works everywhere. Also we can use it if we don't want to set `pattern:s` flag (or it's not supported), in cases when we want a regular "no-newline" dot too in the pattern.
158+
Also we can use this trick if we want both kind of "dots" in the same pattern: the actual dot `pattern:.` behaving the regular way ("not including a newline"), and also a way to match "any character" with `pattern:[\s\S]` or alike.
159159
````
160160

161161
````warn header="Pay attention to spaces"

0 commit comments

Comments
 (0)