Find Characters with Lazy Matching

preview_player
Показать описание
What is greedy matching in JavaScript? Greedy matching is the default behavior of regular expressions, where the regular expression engine will try to match as much text as possible. In contrast, non-greedy matching, also known as lazy matching, tries to match as little text as possible. For example, the regular expression.

What is lazy matching in JavaScript? In regular expressions, a greedy match finds the longest possible part of a string that fits the regex pattern and returns it as a match. The alternative is called a lazy match, which finds the smallest possible part of the string that satisfies the regex pattern.
Рекомендации по теме