Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lazy match #264

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<pre>
"/(fa.*?at)/g" => The <a href="#learn-regex"><strong>fat cat</strong></a> sat on the mat and another <a href="#learn-regex"><strong>fat cat</strong></a> got jealous.</pre>

Without using this the `?` to match in a lazy way it would look like this.

<pre>
"/(fa.*at)/g" => The <a href="#learn-regex"><strong>fat cat sat on the mat and another fat cat </strong></a>got jealous.</pre>


[Test the regular expression](https://regex101.com/r/hxE4kq/1)


## Contribution

Expand Down