Find Characters with Lazy Matching, Learning about Regular Expressions in 2020, Learn Regex Features

preview_player
Показать описание
In this regular expression tutorial, we continue looking at available regex features. Specifically, we look at regular expression lazy matching. With lazy matching regular expressions, we simply mean, finding the shortest possible part of a string that achieves the pattern of the regular expression. We learn that, by default, regular expressions use greedy matching. This means that the regex returns the longest possible string that satisfies the regular expression pattern. This means if we want to find the shortest possible pattern we must use lazy matching to correctly match the desired pattern. Learning about lazy matching allows one to target the smallest pattern matches for our regex. Learning how the concept works are key, so that you may be aware of it for any future use when needed.

Рекомендации по теме
Комментарии
Автор

i cant understand why "c" in titanic wasnt pulled when it's [a-z]*

OscarLorenzoStaCruz