Skip to content

Commit beac683

Browse files
committed
minor
1 parent c84adf8 commit beac683

File tree

1 file changed

+3
-4
lines changed
  • 9-regular-expressions/13-regexp-multiline-mode

1 file changed

+3
-4
lines changed

9-regular-expressions/13-regexp-multiline-mode/article.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ alert( str.match(/^\d+/gm) ); // 1, 2, 33
2020
*/!*
2121
```
2222

23-
Without the flag `pattern:/.../m` only the first number is matched:
23+
The regexp engine moves along the text and looks for a line start `pattern:^`, when finds -- continues to match the rest of the pattern `pattern:\d+`.
2424

25+
Without the flag `pattern:/.../m` only the first number is matched:
2526

2627
```js run
2728
let str = `1st place: Winnie
@@ -33,9 +34,7 @@ alert( str.match(/^\d+/g) ); // 1
3334
*/!*
3435
```
3536

36-
That's because by default a caret `pattern:^` only matches at the beginning of the text, and in the multiline mode -- at the start of a line.
37-
38-
The regular expression engine moves along the text and looks for a string start `pattern:^`, when finds -- continues to match the rest of the pattern `pattern:\d+`.
37+
That's because by default a caret `pattern:^` only matches at the beginning of the text, and in the multiline mode -- at the start of any line.
3938

4039
## Line end $
4140

0 commit comments

Comments
 (0)