Skip to content
Open
Changes from 1 commit
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
Next Next commit
update section lazy match
  • Loading branch information
JulianvonGebhardi committed Jan 15, 2023
commit 9acaf669efc77947e55e7522920d6a2ee21d7cbc
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,19 @@ possible. We can use `?` to match in a lazy way, which means the match should be
"/(.*?at)/" => <a href="#learn-regex"><strong>The fat</strong></a> cat sat on the mat. </pre>


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

This becomes even more useful when using the global flag.

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

Without using this the <pre>?</pre> to match in a lazy way it would look like this.

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


[Test the regular expression](https://regex101.com/r/AyAdgJ/2)


Expand Down