Skip to content

Commit 00faad0

Browse files
authored
fix; typo
1 parent fe5e5f0 commit 00faad0

File tree

1 file changed

+1
-1
lines changed
  • 9-regular-expressions/10-regexp-greedy-and-lazy

1 file changed

+1
-1
lines changed

9-regular-expressions/10-regexp-greedy-and-lazy/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ alert( str2.match(regexp) ); // <a href="link1" class="doc">, <a href="link2" cl
293293
量词有两种工作模式:
294294

295295
贪婪模式
296-
: 默认情况下,正则表达式引擎会尝试尽可能多地重复量词字符。例如,`pattern:\d+` 会消费所有可能的字符。当无法消费更多(在尾端没有更多的数字或字符串)时,然后它再匹配模式的剩余部分。如果没有匹配,则减少重复的次数(回溯),并再次尝试。
296+
: 默认情况下,正则表达式引擎会尝试尽可能多地重复量词字符。例如,`pattern:\d+` 会消耗所有可能的字符。当无法消耗更多(在尾端没有更多的数字或字符串)时,然后它再匹配模式的剩余部分。如果没有匹配,则减少重复的次数(回溯),并再次尝试。
297297

298298
惰性模式
299299
: 通过在量词后添加问号 `pattern:?` 来启用。正则表达式引擎尝试在每次重复量化字符之前匹配模式的其余部分。

0 commit comments

Comments
 (0)