diff --git a/README.md b/README.md index 9c1c4b2..b1d4599 100644 --- a/README.md +++ b/README.md @@ -590,6 +590,19 @@ possible. We can use `?` to match in a lazy way, which means the match should be [Test the regular expression](https://regex101.com/r/AyAdgJ/2) +This becomes even more useful when using the global flag. + +
+"/(fa.*?at)/g" => The fat cat sat on the mat and another fat cat got jealous.+ +Without using this the `?` to match in a lazy way it would look like this. + +
+"/(fa.*at)/g" => The fat cat sat on the mat and another fat cat got jealous.+ + +[Test the regular expression](https://regex101.com/r/hxE4kq/1) + ## Contribution