mirror of
https://github.com/ziishaned/learn-regex.git
synced 2025-09-07 06:07:00 -04:00
update section lazy match
This commit is contained in:
parent
40f1207d9a
commit
9acaf669ef
13
README.md
13
README.md
@ -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)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user