From c301f7c92d4ec8b98619fb68d0bef7550a1e01e4 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Mon, 1 Jul 2019 14:02:20 +0300 Subject: [PATCH] minor --- .../15-regexp-infinite-backtracking-problem/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/9-regular-expressions/15-regexp-infinite-backtracking-problem/article.md b/9-regular-expressions/15-regexp-infinite-backtracking-problem/article.md index 9da262b9..67f3e93c 100644 --- a/9-regular-expressions/15-regexp-infinite-backtracking-problem/article.md +++ b/9-regular-expressions/15-regexp-infinite-backtracking-problem/article.md @@ -112,7 +112,7 @@ First, one may notice that the regexp is a little bit strange. The quantifier `p Indeed, the regexp is artificial. But the reason why it is slow is the same as those we saw above. So let's understand it, and then the previous example will become obvious. -What happened during the search of `pattern:(\d+)*$` in the line `subject:123456789z`? +What happens during the search of `pattern:(\d+)*$` in the line `subject:123456789z`? 1. First, the regexp engine tries to find a number `pattern:\d+`. The plus `pattern:+` is greedy by default, so it consumes all digits: